如何修复它
Warning: Cannot use
setFieldsValue
until you usegetFieldDecorator
orgetFieldProps
to register it.
最佳答案
我在 react 钩子(Hook)上遇到了同样的问题。以下解决方案对我有用。
props.form.getFieldDecorator('Amount', { initialValue: 'My Value' })
因为我觉得原因是 initialValue 在第一次渲染后不会改变,就像 defaultValue 一样。
关于antd - 如何修复它无法使用 `setFieldsValue`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48329596/