-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Many developers are starting to adopt Server Actions in Next.js App Router and Astro, but there is currently no official guidance on how to integrate this approach with react-hook-form
.
As an open-source user of this library, I’ve found it challenging to find reliable patterns for combining react-hook-form
with the new server-side form submission approach.
Describe the solution you'd like
I’d love to see an official guide or example on how to:
- Use
react-hook-form
with a<form action={serverAction}>
pattern. - Handle validation (client + server) using libraries like
zod
. - Return and display errors on the client.
- Use server responses for success messages or revalidation.
Additional context
This kind of guide would be very helpful for those using the Server Actions, particularly with Next.js or Astro where Server Actions are becoming more stable and widely adopted.
If maintainers are open to this, it could be a valuable addition to the docs, even under an “experimental” section.