typescript中使用antd.form.create

typescript中使用antd.form.create

报错内容如下

与类型“IntrinsicAttributes & IntrinsicClassAttributes<Component<Pick<FormComponentProps

  • 解决办法如下:
1 import {FormComponentProps} from 'antd/lib/form/Form';
2 interface CreateNoticeModalProps extends FormComponentProps {
  isShow: boolean
  onCancel: any
  onOk: any
}
3 class Test extends React.Component<CreateNoticeModalProps{}> {}
4 最关键的
export default Form.create<CreateNoticeModalProps>()(CreateNoticeModal)