I have a TypeScript TSX file with a React component like this:
interface IHiProps {
a: string;
b: string;
}
interface IHiState {
}
class Hi extends __React.Component<IHiProps, IHiState> {
// render…
}
How do I correctly render this component in TypeScript?
var hiComponent: __React.Component<IHiProps, IHiState>;
hiComponent = __React.render(__React.createElement(Hi), { a: "A", b: "B" }, document.body);
This fails me with Argument of type 'typeof Hi' is not assignable to parameter of type 'ComponentClass'. I am using definitely typed files from the DefinitelyTyped repository of Boris Yankov.