🚢 @tanstack.com Query v5.63.0 ships with a great new feature: The ability to unsubscribe an observer from the cache. This will hopefully help in react-native, where screens might stay mounted even if they aren't visible. Unsubscribing makes sure those don't re-render and won't trigger fetches.
Post
github.comRelease v5.63.0 · TanStack/queryVersion 5.63.0 - 1/8/25, 2:21 PM
Changes
Feat
react-query: allow useQuery and useQueries to unsubscribe from the query cache with an option (#8348) (e2bc216) by Dominik Dorfmeister
Packages
@tan...
Wonder how this would compare with react-freeze + react-navigation integration Any idea @hirbod.dev @kzzzf.bsky.social ? github.com/software-man...
github.comGitHub - software-mansion/react-freeze: Prevent React component subtrees from rendering.Prevent React component subtrees from rendering. Contribute to software-mansion/react-freeze development by creating an account on GitHub.
This was one of the topics that I had with @tkdodo.eu. React freeze did prevent re-rendering, but the observers would still fetch and run, just the rendering would be frozen. With the new flag, you can make sure to stop out of screen views/components from actually doing anything unless subscribed
0 reposts3 likes