TS2415: Class 'MyComponent' incorrectly extends base class
I have created the following code snippet:
import * as React from "react";
export interface IMyProps {
}
export interface IMyState {
}
export class MyComponent extends React.Component<IMyProps, IMyState> {
constructor(props: IMyProps) {
super(props);
}
render() {
}
}
But the TypeScript compiler gives me the following error:
(9,14): error TS2415: Class 'MyComponent' incorrectly extends base class 'Component'. Types of property 'render' are incompatible. Type '() => void' is not assignable to type '() => false | Element'. Type 'void' is not assignable to type 'false | Element'.
What's wrong here?