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
I want to disable the submit button after the submission. I compare options.defaultValues and values from the store to determine whether they are equal. However, the next render after submission contains stale options. This happens likely because of the useIsomorphicLayoutEffect that updates the options here. I wonder maybe the formApi.update can be called during the render
Describe the bug
I want to disable the submit button after the submission. I compare
options.defaultValues
andvalues
from the store to determine whether they are equal. However, the next render after submission contains stale options. This happens likely because of theuseIsomorphicLayoutEffect
that updates the options here. I wonder maybe theformApi.update
can be called during the renderYour minimal, reproducible example
https://codesandbox.io/p/sandbox/elated-brahmagupta-sj6mvk
Steps to reproduce
Expected behavior
As a user, I expect that the submit button is disabled after the first click, but it becomes disabled only after the second click
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
TanStack Form adapter
react-form
TanStack Form version
v0.39.0
TypeScript version
v4.4.4
Additional context
If the useQuery is replaced with a useState then everything works as expected.
The text was updated successfully, but these errors were encountered: