What's the difference between React.Component and typeof React.Component?

in the following code snippet,

type T1 = React.Component;
type T2 = typeof React.Component;

what"s the difference between T1 and T2?

< hr >

go one step further and give the following definition:

class CardHeader extends React.Component {...}

and a function: defined elsewhere to render it

  • Function definition-sharp1
function renderCardHeader(Comp: React.Component) {
    return <Comp />;
}
  • Function definition-sharp2
function renderCardHeader(Comp: typeof React.Component) {
    return <Comp />;
}

Function definition-sharp1 will report an error in < Comp / > in TS 2.9.2:

JSX element type "Comp" does not have any construct or call signatures.

Why is this? Isn"t React.Component a type?

also, in the Function definition-sharp2, Comp: typeof React.Component , what is the type of a type?

Apr.07,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b22443-2b61c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b22443-2b61c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?