T
TanStack2y ago
ambitious-aqua

Storing class instance in cache

Hey, I want to use value object pattern, implementation is done through class, is there any risk when storing class instance in react-query cache? I tested it and works fine but still want to double check with you.
3 Replies
notable-maroon
notable-maroon2y ago
structural sharing won't work, but that's about it
flat-fuchsia
flat-fuchsia2y ago
What's the effect of structural sharing not working?
notable-maroon
notable-maroon2y ago
Render Optimizations | TanStack Query React Docs
React Query applies a couple of optimizations automatically to ensure that your components only re-render when they actually need to. This is done by the following means: structural sharing

Did you find this page helpful?