How to preserve value in form when an action got validation errors? #296
Unanswered
armandabric
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Did you find a solution ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey there!
I'm struggling to use
next-safe-action
with a form that could be rejected with validation errors.When the form is submit Next 15 (or React 19?) reset it, and I could not find a way to prevent it to became empty. After a submition that trigger validation errors, the
action.result
entry is only filled with thevalidationErrors
. It seems there is no way to send back the data back like advised now with the reactuseActionState
.I have created a demo to illustrate my problem: https://codesandbox.io/p/devbox/rv6f4c
Is someone have an idea on how to do?
Beta Was this translation helpful? Give feedback.
All reactions