useQuery and state management #5408
Unanswered
joshtheflame
asked this question in
General
Replies: 1 comment 1 reply
-
It seems that in your case you don't need to use context at all. Hope this will help: https://tanstack.com/query/v4/docs/react/guides/does-this-replace-client-state |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I have the following component in which when the component executes it fetches the "Tasks" via API and set the global state of context api inside "useEffect" hook and renders on screen. I have read somewhere that useQuery provides state mangement as well so the way I am setting state here after useQuery is there a way to set state within useQuery so I dont need to set it for context api or my understanding is wrong. Please guide is this the right approach or should I opt different approach.
Beta Was this translation helpful? Give feedback.
All reactions