Using form action in Next.js triggers automatic router cache revalidation, causing the server component to re-render and remount the client component, which resets all useState values. Switching to onSubmit with e.preventDefault() prevents this behavior while preserving full functionality. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
29 KiB
29 KiB