Get touched and errors props into Wizard.Page from Formik Multistep example
See original GitHub issue📖 Documentation
I think the Multistep example is one of most used use cases for Formik and quite elegant. Before I rewrite the whole thing, probably somebody can help: I wrapping my head around how to get the touched and errors props from Formik into the Wizard page. I don’t want to use the ErrorMessage Component because one of my own components within Wizard.Page relies on touched and errors from <Formik />
.
What I tried: Adding touched and errors as args in Formik render prop in line 62: https://github.com/jaredpalmer/formik/blob/344b846bc25865dc02b6304e7c9f447b5b1552fd/examples/MultistepWizard.js#L62 but I don’t know how to access it within Wizard.Page, e.g. like this:
<Wizard.Page>
{props => (
<MyCustomField errors={props.error} touched={props.touched} />
...
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Building multi-step wizards with Formik and React Query
Learn how to build multi-step wizards in a small proof-of-concept application with Formik and React Query right here.
Read more >Formik Multi-Step Form with Material UI | React JS ... - YouTube
In this video we explore how to create a multi-step form ( wizard ) in ReactJS using the Formik 2 library, Material UI,...
Read more >Build a multi-step form with React Hooks, Formik, Yup and ...
Let's go through the code we've just added. · The component is initialized with the default value for step in state as 0,...
Read more >Access values from previous step using Formik Wizard
You can use React context or Redux for this purpose. Here's how to do it with React Context. Step1: Create a "provider" which...
Read more >Tutorial - Formik
Learn how to build forms in React with Formik. ... Getting values in and out of form state; Validation and error messages; Handling...
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
Yep, that’s the same as using
useFormikContext
, except Field does it for you. You can also use (for thoroughness’ sake):Np, I’m closing this in favor of #1725