When I extend React.Component like this:
export default class App extends React.Component<any, any > {
constructor (props: React.ReactPropTypes) {
super(props);
}
// other code
}
I got the following warnings:
./src/App.tsx [37, 50]: Type declaration of 'any' loses type-safety. Consider replacing it with a more precise type, the empty type ('{}'), or suppress this occurrence. [37, 55]: Type declaration of 'any' loses type-safety. Consider replacing it with a more precise type, the empty type ('{}'), or suppress this occurrence.
Which is the best way to solve these warnings?
{}instead, if your component doesn't really need anything from its props and state. If the component does demand something from its props/state, express that in the type signature.