Side effects in useQuery function or outside of useQuery in a useEffect? #1939
Unanswered
shamilovtim
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The queryFn should be pure imo, you can trigger side effects in the onSuccess / onError / onSettled callbacks or in dedicated effects. Which side effects are we talking about? moving this to discussions as it’s not a bug. |
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
-
Describe the bug
Do the author or the contributors of this library have any opinions on the presence of side effects in the useQuery function, or should side effects be outside of useQuery in a useEffect of a custom hook?
The Queries docs page does not seem to take a stance on this and the rest of the docs don't come up with any opinions. Curious about your experiences and any pros / cons. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions