Используйте tslint.
У нас есть следующий код:
export default class TableCell extends React.PureComponent<IProps, IState> {
static getDerivedStateFromProps(nextProps: IProps, prevState: IState) {
return nextProps.status !== prevState.status ? {
status: nextProps.status
} : null;
}
constructor(props: any){
super(props);
this.state = {
status: props.status
};
}
...
}
Что вызывает следующую ошибку:
Метод класса 'getDerivedStateFromProps' должен быть помечен как 'private', 'public' или 'protected'
В чем проблема?