Conform + Next.js 15: How to prevent a form getting reset when the Server Action returns an error? #981
-
Hello, ![]() What do I want? Environment:@conform-to/react: ^1.8.0 Minimal Reproducible Example:Here is the complete code for my Server Action and the Sign-in form. 1. Server Action (app/credentials-signin-action.ts)
(Please note: I am using Effect-TS in my application, which is why you see the JavaScript generator syntax.) 2. Sign-in Form (components/auth/credentials-signin-form.tsx)
Key Debugging Findings: When I log the value of ![]() But when I log the object returned by ![]() Is the reason the form fields are not preserving their values when the form receives an error as there is no Github Repo |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What you are seeing is caused by the new form-reset behavior in React 19, which Conform doesn't fully support yet. We are actively working on an improved useForm hook and expect to ship it in the next couple of weeks. In the meantime, try the workaround here: #681 (comment) |
Beta Was this translation helpful? Give feedback.
What you are seeing is caused by the new form-reset behavior in React 19, which Conform doesn't fully support yet. We are actively working on an improved useForm hook and expect to ship it in the next couple of weeks. In the meantime, try the workaround here: #681 (comment)