Open yoyo837 opened 5 years ago
the same problem
Me too..!
In the doc of the Ant, is recommended use ForwardRef of the React.
Doc Ant: https://ant.design/components/form/#components-form-demo-customized-form-controls Example: https://codesandbox.io/s/antd-reproduction-template-q4bdi
Seems the example is not for connect component
how to save
尝试下: @connect(mapStateToProps, null, null, { forwardRef: true })
@webwyb 为什么需要ref才不会报错啊,现在connect是函数组件了么?
@connect(mapStateToProps, null, null, { forwardRef: true })
Thanks @webwyb , this worked for me if anyone is in a similar boat my code ended up as:
export default compose(
Form.create({ name: 'formName' }),
connect(mapStateToProps, { actionCreators }, null, { forwardRef: true })
)(ComponentName)
Item.js:
use:
If the
getFieldDecorator
receives a@connect
connected component, you will get the warning.A temporary solution is:
Item.js
related: ant-design/ant-design/issues/11324