Moezalez Moezalez - 6 months ago 47
React JSX Question

How to flow type a Component?

type Props = {
Component: ???
const AnotherComp = ({Component}: Props) => (
<Component />

What's the proper way to add a prop for the component?


The type that you're looking for is called ReactClass. The type for any component would be ReactClass<any>.

Check out this similar question: What type to use for things React can render?