【发布时间】:2019-04-24 08:04:09
【问题描述】:
我有一个由 Form.create() 创建的表单,但我无法编译成功。
类似的错误:
Argument of type 'FunctionComponent<MyProps>' is not assignable to parameter of type 'ComponentType<{}>'.
Type 'FunctionComponent<MyProps>' is not assignable to type 'FunctionComponent<{}>'.
Type '{}' is missing the following properties from type 'MyProps': form, and 2 more
我的代码是:
import { FormComponentProps } from "antd/lib/form";
interface MyProps extends FormComponentProps {
form: any;
}
const TableQuery: FunctionComponent<MyProps> = (props: MyProps) => {
// some code
};
const WrappedTableQuery = Form.create<MyProps>()(TableQuery)
export default WrappedTableQuery;
我该如何解决这个错误。
【问题讨论】:
-
只安装lates antd,已经修复,我的版本:3.18.1
标签: reactjs typescript antd