-
Hello there, I use I have a parent component that renders a list of items. For each item, I create on the a store provider using react contex by following this pattern from docs
When the component is unmounted the ReduxDevTools inspector still show all previously created stores. something like
So, my question is twofold: Are these ghost stores a sign of memory leaks or just a glitch/bug in Redux DevTools? And do I really need to worry about destroying stores, or is it more of a nice-to-have cleanup? Any insights or advice would be greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@frin88 as I know it's a known issue with devtools middleware but may I'm wrong @dai-shi do you have any thoughts? |
Beta Was this translation helpful? Give feedback.
Yes, stores are garbage collectable. I would recommend to make sure all listeners are unsubscribed.
I'm not sure if we have stable devtools other than redux one.
zustand/docs/integrations/third-party-libraries.md
Line 37 in 9d24d11
seems like an experimental one.
I think it's open space for anyone to jump in and develop Zustand-specific devtools.
FYI, Jotai has one: https://github.com/jotaijs/jotai-devtools