I am a freshman with typescript. I don't understand this error in my code.
I use the IProps
to describle the props of the class. Why does the typescript check the method of this class ? How can I solve this problem?
export interface IProps extends FormComponentProps {
dispatch: Dispatch<any>;
loading: any;
}
@Form.create()
@connect(({ global, loading }) => ({ global, loading }))
export default class MessageBoard extends PureComponent<IProps> {
state = {
activated: false,
};
deactivate = () => {
this.setState({ activated: true });
};
...
render() {
...
return (...);
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…