Moezalez Moezalez - 1 year ago 91
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?

Answer Source

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?