箭头函数与class函数使用Antd Form组件中 Form.create()的方法

class函数使用Form.create():

class CustomizedForm extends React.Component {
...代码
}

CustomizedForm = Form.create({})(CustomizedForm);

箭头函数使用Form.create():

const aaa =(form)=>{
...代码
}

const Aaaa = Form.create()(aaa);


在箭头函数中,为了使用form的api,如: getFieldsValue   getFieldValue   setFieldsValue等,需要传入form参数,才能正确传入from


猜你喜欢

转载自blog.csdn.net/game7752/article/details/80224104