Pass values from component state to handleSubmit
See original GitHub issueFirst of all, thank you for the library! 👍
Is there a way to pass values from the component state to handleSubmit
function? Say, I want to manage some part of the form by myself, then “glue” it with formik-managed values.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
I want to pass my input values from Form to handleSubmit ()
Your messageForm should update your state using an onChange handler. Then handleSubmit should preventDefault() and dispatch your sendNewMessage ...
Read more >React interactivity: Events and state - Learn web development
We want our handleSubmit() function to ultimately help us create a new task, so we need a way to pass information from <Form...
Read more >withFormik() | Formik
Create a higher-order React component class that passes props and form handlers (the " FormikBag ") into your component derived from supplied options....
Read more >Handling Events - React
React events are named using camelCase, rather than lowercase. With JSX you pass a function as the event handler, rather than a string....
Read more >What's the difference between `handleSubmit` and `onSubmit`?
How do I pass form value(s) to my own submit handler? # ... Simply write your components as you normally would, passing handleSubmit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jaredpalmer I was overthinking things so it turned out to be very simple. I just need to manage the whole state of the form with Formik.
I managed to get it working with
setValues
helper — I just pass values from the state like:Thank you for your time! Case solved.
@mwickett Formik x Draftjs example: https://codesandbox.io/s/QW1rqjBLl