rekit / antd-form-builder

Dynamic meta driven React forms based on antd.

Home Page:https://rekit.github.io/antd-form-builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how do I get access to the data??

lemarcgagnon opened this issue · 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)

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...

commented

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.