Replies: 1 comment 1 reply
-
This scenario totally depends on how you deal with the form state. E.g React-hook-form function App() {
const {data: values} = useQuery()
const [trigger] = useMutation()
useForm({
values, // will get updated once values returns
})
const onSubmit = (formValues)=>{
trigger(formValues)
}
}
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I have a use case where I ll need to fetch some data via useQuery and would need to store the data as a default value on a form which is later on edited by users. Once the user is done with editing, I then use useMutation to commit the change to the server.
Question is how do we correctly store the data from useQuery into local state of a component?
thanks
Beta Was this translation helpful? Give feedback.
All reactions