-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
RFC: isValid prop for the whole form #94
Comments
@bcarroll22 So we could add a computed One option we thought about was a I think the best solution is exposing a an option called <WrappedComponent
isValid={(!dirty && isFunction(isInitialValid) ? isInitialValid(this.props) : isInitialValid) || Object.keys(this.state.errors).length > 0}
...
/> What do you think? P.S. Add prolio.com to #87 ! |
@jaredpalmer got it, all of that makes sense. I wasn't really thinking of it in the context of SSR but I've got it now. Would it also break SSR to have Formik manage an internal And cool! I'll definitely throw it in #87. Formik definitely took our forms to another level, it really helped out. |
Hi all, any example of this implementation? I couldnt find it working without having to do a change in the form. Im looking for a solution to get isValid of the form on load. Im using Yup validations and wrapping it WithFormik. Thanks |
Hey guys!
First of all, we've really enjoyed using Formik in our products. It's made form submission so much easier. One pain point that we have in our usage though is that there's no easy way to always tell if the whole form is valid.
This would be nice for doing something like disabling the submit button based off one prop instead of having to check for other things. For example, as far as I can tell nothing shows up in the errors array until at least one field has been typed in. So although the form is invalid, you can't tell that just by checking the errors array.
Just wanted to see if anyone else thought something like that would be a good idea... Thanks again for the awesome library!
The text was updated successfully, but these errors were encountered: