Here are some of the types defined by @types/react that it might be useful to know about:
- Component: This is the base class for class components.
- FunctionComponent or FC (shorthand): This is the base interface for Functional Components.
- ReactNode: This is any React element that can be rendered. This type is often useful for child components.
- JSX.Element: This is the type used for all JSX expressions. Note that JSX expressions are black boxes.
- JSX.IntrinsicElements: These are all built-in components (for example, div, span, and so on).
Components written using TypeScript can, of course, accept props—let's see how.