我使用IProps
来描述班级的道具。为什么打字稿检查此类的方法?我该如何解决这个问题?
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 (...);
}
}