stateTime vs refetchOnMount to avoid refetch in each component mount #4533
Unanswered
crisfcodes
asked this question in
Q&A
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
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 a request which I run when the component is mounted, what I want is to avoid this request running in each of the component re-mounts. I have reviewed the documentation and I have found two possible solutions,
stateTime: Infinity
andrefetchOnMount: false
, with both options I get the component to only run the request once, I want to know the pros and cons of each option or if there is any option that I have not taken into account that fits better for this use case.@TkDodo
Beta Was this translation helpful? Give feedback.
All reactions