T
TanStack8mo ago
flat-fuchsia

should I use useRef when using tanstack query in my stack layout file?

windsurf suggested that I do this instead, is this correct? its my first app so sorry for the noob question
No description
4 Replies
flat-fuchsia
flat-fuchsiaOP8mo ago
it was like this before except it wrapped my stacks
No description
quickest-silver
quickest-silver8mo ago
Move it outside of the component or useState There’s eslint plugin rules for a variety of things, like this
quickest-silver
quickest-silver8mo ago
Stable Query Client | TanStack Query Docs
The QueryClient contains the QueryCache, so you'd only want to create one instance of the QueryClient for the lifecycle of your application not a new instance on every render. Exception: It's allowed...
flat-fuchsia
flat-fuchsiaOP8mo ago
thank you this seems helpful

Did you find this page helpful?