Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do I get access to the data?? #47

Open
lemarcgagnon opened this issue Jul 8, 2020 · 2 comments
Open

how do I get access to the data?? #47

lemarcgagnon opened this issue Jul 8, 2020 · 2 comments

Comments

@lemarcgagnon
Copy link

lemarcgagnon commented Jul 8, 2020

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
Copy link
Author

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

@berakoc
Copy link

berakoc commented Dec 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants