React Query Infinite Re-Rerender
Hello,
I'm noticing a weird behavior with my code. I'm pretty certain I'm doing something wrong, I'm just not sure what.
The gist of what is going on is that I have a hook to fetch some data from the server and cache it locally. That works great! Now I'm trying to add a
I am using things like the persist plugins, and actually noticed that it's constantly writing to the localStorage (the timestamp increases). However inspecting the items, the
Any obvious ideas as to what is going on?
I'm noticing a weird behavior with my code. I'm pretty certain I'm doing something wrong, I'm just not sure what.
The gist of what is going on is that I have a hook to fetch some data from the server and cache it locally. That works great! Now I'm trying to add a
demo mode so that a user can play around with some mock data before signing into the product. For some reason, the second I add if (demo.isDemo) return demoData;, I start to get infinite re-renders. Removing the line immediately fixes it, adding it back breaks it again.I am using things like the persist plugins, and actually noticed that it's constantly writing to the localStorage (the timestamp increases). However inspecting the items, the
dataUpdateCount is a super low number.Any obvious ideas as to what is going on?