JSX.IntrinsicElements
以下のようにHTML要素の型が列挙されている
code:ts
interface IntrinsicElements {
// HTML
a: React.DetailedHTMLProps<React.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>;
...
body: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>;
br: React.DetailedHTMLProps<React.HTMLAttributes<HTMLBRElement>, HTMLBRElement>;
...
// SVG
svg: React.SVGProps<SVGSVGElement>;
...
}
例えば、IntrinsicElements['a']とすれば、<a>のpropsの型が得られる
https://dev.to/ferdaber/typescript-and-jsx-part-iii---typing-the-props-for-a-component-1pg2