TypeScript error on custom Yup validation schema. #10853
Unanswered
scheng-niche
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
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am building a stepper/wizard-like form in which the questions on each page changes upon "Next" button clicks. I am using the custom Yup resolver shown here: https://www.react-hook-form.com/advanced-usage/#CustomHookwithResolver
Each page of the form has an array of questions; each question has a type and an id. I'm building a validation schema that is keyed off of question ids since there could be multiple question types per page (e.g. inputs, radio button groups, custom special questions, etc.)
I use a lookup object to determine the validation schema depending on the question type.
I am getting an error on the
is
property of a validation schema and I cannot figure out what it is referring to or how to fix it:Upon playing with it, I have gotten the TS errors to go away by making the schema look like this but can't figure out why this works and the above does not:
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions