Given:
type T1 = React.Component;
type T2 = typeof React.Component;
What's the difference between T1 and T2?
Further question. Given the following class definition:
class CardHeader extends React.Component {...}
And a function to render it somewhere else:
Function definition #1:
function renderCardHeader(Comp: React.Component) {
return <Comp />;
}
Function definition #2:
function renderCardHeader(Comp: typeof React.Component) {
return <Comp />;
}
Definition #1 is not working and TS (version 2.9.2) is giving me the following error at <Comp />:
JSX element type 'Comp' does not have any construct or call signatures.
I'm very confused - isn't React.Component a type?
And as for #2, Comp: typeof React.Component, what is a type of another type?