Follow me on Twitter, happy to take your suggestions on topics or improvements /Chris
This is the continuation of our first part on Formik, the a...
For further actions, you may consider blocking this person and/or reporting abuse
Is it possible to use validationSchema and async validation simultaneously for one Formik Component? Thanks for usefull tutorial. Yup looks mutch smarter than AvForm in Bootstrap.
I believe so.. Let me see if I can come with an example of that to show how..
Yea here I have such an example github.com/softchris/formik-exampl...
Hi Chris,
I tried using Formik,Yup and MaterialUi together. But it seems like there is a considerable lag when typing in the textfields (of the materialUI) present in the form. The form that I'm using contains many inputs, maybe why the lag is being caused. Any way to avoid this delay ?. Also is there a full rendering of the component, when the validation is done ?
My best guess is that the validation is triggered on every keystroke. You should try to disable it with
validateOnBlur={false}
validateOnChange={false}
Thanks Chris. This was a really good article. I have implemented a form with Formik and got all the validation hooked up. For the last week I have been struggling on how to show an alert on success or failure after the submission. In my case I call an API to add a record to a database. If a record was successfully added the API response will have stuff and I display a success alert. If it fails the response is empty and I display an error alert. What I want to do is retain the form field values so if there was an error the form is not blank when I close the alert.
I feel like this is something to do with the state of the form and/or fields and that I need to do something in the on submit. Like ...values or ...prevState or something.
This is currently my onSubmit area of the form:
Thanks in advance if you have any hints
it was very interesting challenge to combine Formik, yup, material-ui and react-select 2... and it works all together! :)
one feature was very helpful in case of using redux with data for initialValues: enableReinitialize
Hey Chris!
I believe you meant to use
<Form>
built-in component in your first code snippet instead of<form>
.aah... thank you :)
This article is amazing , you have explianed it very well. Please make part 3 touching useFormikContext() and handling parts of form in child components