React query with react hook form #4844
-
Hey guys I have a query that gets a user by email when the form is submitted const { data: userAuth, refetch: refetchCreateUserAuth } = useQuery( const { data: userStores } = useQuery( const { data: merchantSession } = useQuery(queryKeys.publicUser, () => { const onFormSubmit = (data: SignInWithPasswordData) => { |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi 👋
TanStack Query manages asynchronous state for you. If you need to derive state from the state of the query then you can, although it's usually better avoided.
You can express dependent queries with the Also, it looks like you might be using a query to perform a mutation (signing in), although it's hard to reason about your implementation given the unformatted example and lack of context. |
Beta Was this translation helpful? Give feedback.
Hi 👋
TanStack Query manages asynchronous state for you. If you need to derive state from the state of the query then you can, although it's usually better avoided.
You can express dependent queries with the
enabled
option. Please see: https://tanstack.com/query/v4/docs/react/guides/dependent-queriesAlso, it looks like you might be using a query to perform a mutation (signing in), although it's hard to reason about your implementation given the unformatted example and lack of context.