I want to write a function, which renders react component, passed as argument to that function. I want to handle both Component and StatelessComponent types. This is how I do that:
function renderComponent(component: React.ComponentClass<any> | React.StatelessComponent<any>) {
return <component />;
}
I got compilation error:
error TS2604: JSX element type 'component' does not have any construct or call signatures.
What am I doing wrong?