I have a multi-page react-hook-form form and I’m running into a validation issue I can’t seem to wrap my head around. I’m trying to only validate the page the user is on, not pages they haven’t made it to yet.
Here’s a CodeSandbox
If you enter something into the input and click “Next”, you can move on to the next page. If you click “Back” and then try to click “Next” again, it won’t let you because it’s validating the second page but the user isn’t on that page.
I should be able to freely go between page 1 and 2 even though I haven’t added an item to my field array. It should only validate if I try to click “Next” on the 2nd page.