T
TanStack6mo ago
correct-apricot

use external values for form state values

I have a form; values in inputs can be specified by the user manually, but I would like to have as well an ability to pass value from, for example, Zustand. Is that possible? Thank you for any help.
4 Replies
passive-yellow
passive-yellow6mo ago
You can set defaultValue on the form
correct-apricot
correct-apricotOP6mo ago
i just tried to pass values in defaultValue, it doesnt seems to work :(
passive-yellow
passive-yellow6mo ago
Can you make a reproduction Stackblitz? You can fork this one e.g. to get started: https://tanstack.com/form/latest/docs/framework/react/examples/simple
React TanStack Form Simple Example | TanStack Form Docs
An example showing how to implement Simple in React using TanStack Form.
correct-apricot
correct-apricotOP6mo ago
actually in the process of reproducing it on stackblitz, it turned out it works just like you said, now i need to somehow figure out why does it not work in my case.

Did you find this page helpful?