You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After my server action has resolved and returned a successful response the form items are still showing the previous default values (reverting the newly entered values) despite me calling router.refresh() and fetching the latest data in the parent page and passing it down to the client component that renders the form.
To circumvent this issue I attempted to pass Date.now() as a key prop to my client component to force a full rerender which technically works, but it's noticeable that the form resets shortly to the previous default values and then updates with the new values.
I managed to resolve my issue by using submission.reply() instead of returning an object. This approach ensures lastResult in the useForm hook stays updated as expected.
It might be helpful to adjust line 71 in examples/nextjs/app/actions.ts to use submission.reply().
This issue has been fairly old, but in the last week I changed over to use submission.reply() and unfortunately that never worked as expected either.
Chances are that the new React 19 changes which reset forms on submit do contribute to that behavior as well. Once I find some time in the next few days or weeks I will look into an updated reproduction to contribute in order to see whether it's an issue with conform or my custom helper.
Describe the bug and the expected behavior
After my server action has resolved and returned a successful response the form items are still showing the previous default values (reverting the newly entered values) despite me calling
router.refresh()
and fetching the latest data in the parent page and passing it down to the client component that renders the form.To circumvent this issue I attempted to pass
Date.now()
as a key prop to my client component to force a full rerender which technically works, but it's noticeable that the form resets shortly to the previous default values and then updates with the new values.Conform version
v1.2.2
Steps to Reproduce the Bug or Issue
What browsers are you seeing the problem on?
Chrome, Safari
Screenshots or Videos
CleanShot.2024-09-30.at.00.30.54.mp4
Additional context
No response
The text was updated successfully, but these errors were encountered: