I have a question regarding JSX and Typescript integration. Given the following code:
interface Props {
component?: React.ReactType
}
class MyComponent extends React.Component<Props, void> {
render() {
var Comp = this.props.component
return (<Comp></Comp>)
}
}
I get: JSX element type 'Comp' does not have any construct or call signatures.
How do I fix this? Similar code works fine in Javascript where component has prop validator elementType from react-prop-types, so it could be either a string or component class.