updating validationSchema dynamically when using hooks #3767
Unanswered
buildxyz-git
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Similar to 1436 but I am using the react hook
useFormik
. I would like to setvalidationSchema
after fetching a JSON schema in an API call and use schema-to-yup to create the Yup validation function.So I currently do this:
Later I try to do this:
This results in no validation being performed, if I create a valid test Yup schema when
useFormik
is initialized it does validate but I need to do it later for my application.useFormik
wrong?setValidationSchema
function was exposed?Beta Was this translation helpful? Give feedback.
All reactions