Multi-step form with Next, Tailwind, React Hook Form, Yup, Toastify.

Solution retrospective
I'm proud of using Next.js for the first time, as well as leveraging React Hook Form, which I'm familiar with. I also enjoyed using Tailwind CSS for the first time to style the form. Next time, for a static site, I might choose a different framework, as I’m not using a database, and Next.js might have been overkill. I’m still learning Next, so it was a good experience overall.
What challenges did you encounter, and how did you overcome them?One challenge I faced with React Hook Form (RHF) was ensuring input validation on blur, as my next/submit buttons weren’t inside the same element. I resolved this by switching the validation mode to onBlur. Additionally, I had to introduce Yup validation on form submission because I couldn't get the RHF controller rule to trigger again, since the confirm button was on the last route and outside the form element.
What specific areas of your project would you like help with?I'm looking for tips on improving my approach to React Hook Form validation, particularly with handling validation on blur when buttons are outside the element, and how to better integrate Yup validation with RHF on form submission.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Justin Davies's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord