T
TanStack2w ago
deep-jade

React query + TanStack forms for immediate mutations instead of on submit

Hi, I have a form where I would like to save the edits to the fields immediately (or in case of text inputs with a debounce) to the server instead of when the user hits submit. So basically this should work like an autosave feature. The tanstack form onChange + onChangeDebounceMs api seems ideal for this. How should I handle rapid API calls that lead to potential race conditions and how do I notice when the form state and server state get out of sync? Can anyone provide an example on how to set this up correctly?
1 Reply
wise-white
wise-white2w ago
try using the mutation scope to queue up mutations

Did you find this page helpful?