antd-form-builder icon indicating copy to clipboard operation
antd-form-builder copied to clipboard

how do I get access to the data??

Open lemarcgagnon opened this issue 4 years ago • 2 comments

Hello, I am sooo confused by the example, I simply want to have access to the data and all I get is Object object...

What am I doing wrong?

Although it shows in the console.log, I tried so many ways and spent so many hours to get access to the data. How can I do it?

Yours,

here is my codesandbox : https://codesandbox.io/s/elastic-gates-ncib1?file=/src/App.js

in CodeSandbox, I also get this in the console:

Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Wave which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://fb.me/react-strict-mode-find-node in button (created by Button) in Wave (created by Button) in Button (at App.js:21) in div (created by FormItemInput) in div (created by FormItemInput) in div (created by Context.Consumer) in Col (created by FormItemInput) in FormItemInput (created by FormItem) in div (created by Context.Consumer) in Row (created by FormItem) in FormItem (at App.js:20) in form (created by ForwardRef(Form)) in ForwardRef(Form) (created by ForwardRef(InternalForm)) in SizeContextProvider (created by ForwardRef(InternalForm)) in ForwardRef(InternalForm) (at App.js:18) in Unknown (at src/index.js:9) in StrictMode (at src/index.js:8)

lemarcgagnon avatar Jul 08 '20 13:07 lemarcgagnon

sorry, thanks for the new version, but still due to my lack of knowledge, I still can not log the forms values in LocalStorage,

handleFinish = evt => { console.log('submit: ', this.formRef.current.getFieldsValue()) let ledata = this.formRef.current.getFieldsValue()

console.log("le data",ledata)

}

and I wonder if I were to modify the Class component to a Functional component and send the data in a const [data, setdata] = useState[] if it would work...

lemarcgagnon avatar Jul 13 '20 14:07 lemarcgagnon

First, onFinish does not use event as an argument like onSubmit. So change the name of the parameter as formValues. Second, what is the issue here? Does formValues not updated correctly? In this case, try to use useForceUpdate hook.

berakoc avatar Dec 27 '22 15:12 berakoc