Next.js Forms With Server Actions and useActionState
A contact form built the App Router way: a server action that validates and sends, useActionState for pending and errors, progressive enhancement and spam.
Writing
3 write-ups from production, newest first. Each one is a problem hit on a real project and how it was diagnosed and fixed.
A contact form built the App Router way: a server action that validates and sends, useActionState for pending and errors, progressive enhancement and spam.
Contact forms fail silently and cost months of enquiries. How to test yours in two minutes, why forms stop sending, and how to make sure it never goes unseen.
A practical production setup for a Next.js contact form using React Hook Form, Zod, Server Actions, and Resend, including spam protection and error handling.