T
TanStack2mo ago
absent-sapphire

How to async update field value depending on other fields?

I have the following form:
const defaultValues = {
// (in my real scenario there are quite a few fields including arrays objects etc.)
foo: '',
bar: '',
baz: '',
}
const defaultValues = {
// (in my real scenario there are quite a few fields including arrays objects etc.)
foo: '',
bar: '',
baz: '',
}
when any of the fields "foo" or "bar" changes, make a call to the API, show the loading and change "baz" with the API result I thought about using useQuery because it already has isFetching, combined with useEffect to update and useStore to notify field changes but I don't know if it's the best way...
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?