-
-
Notifications
You must be signed in to change notification settings - Fork 507
Closed
Labels
Description
Describe the bug
It seems like form.reset(value)
is updating defaultValues
, but by the next render defaultValues
are being reset to the initially provided ones. So, as a result, there is no difference whether to call form.reset(value)
or just form.reset()
because they lead to the same result.
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-x8k3rfrs?file=src%2FApp.tsx
Steps to reproduce
- Go to the Stackblitz url.
- Change values in input(s).
- Click "Submit" button.
- After submit,
defaultValues
are being reset to the new ones (you can see it in console). - By the next render,
defaultValues
are back to the initial ones.
Expected behavior
As a user I expect that defaultValues
are updated with the values provided to form.reset
method and not being reset to the initial defaultValues
.
How often does this bug happen?
Every time
Screenshots or Videos
no-reset.mp4
Platform
- OS: Windows 11
- Browser: Chrome
- Version: 135.0.7049.116
TanStack Form adapter
react-form
TanStack Form version
v1.9.1
TypeScript version
v5.8.3
Additional context
No response