I'm not sure why Ariel's solution was downvoted, as it is one of the standard ways to do this with React. Having a prop with React.ComponentType<PropsType>
is one of the most efficient and clear ways to do this. Note that this usually requires you to have another prop of type PropsType
that is then used to instantiate the component.
interface ParentProps {
component: React.Component<CType>
componentProps: CType
}
...
// in Parent
const Component = component // to get uppercase
<Component {...componentProps} />