I have a login form created by Form.create(), but I can\'t pass any props to this form from parent component, compiler always notify a error like
error TS23
Import the FormComponentProps
import {FormComponentProps} from 'antd/lib/form/Form';
Then have your component
interface YourProps {
test: string;
}
class YourComponent extends React.Component {
constructor(props: YourProps & FormComponentProps) {
super(props);
...
}
}
Then export the class using Form.create()
export default Form.create()(YourComponent);
The generic argument on Form.create casts the result to a React ComponentClass with YourProps - without FormComponentProps, because these are being injected through the Form.create wrapper component.