You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that state which is no longer being used can still be retained by some __reactFiber$... internals, leading to arbitrarily large memory leaks depending on what other objects are referenced by the state.
The object is retained by the __reactFiber$... property of the <button> element:
In our app, this behavior leads to a huge graph of objects from a previous screen/route of the app being retained when switching away from that screen.
The expected behavior
The state which is no longer current should be released.
The text was updated successfully, but these errors were encountered:
React version: 18.3.1
Summary
It appears that state which is no longer being used can still be retained by some
__reactFiber$...
internals, leading to arbitrarily large memory leaks depending on what other objects are referenced by the state.Possibly related issues:
Steps To Reproduce
Screen.Recording.2024-08-16.at.12.08.03.PM.mov
Link to code example:
https://stackblitz.com/edit/react-leak-repro-1?file=src%2FApp.tsx,vite.config.ts
This repro case may be slightly more complicated than necessary, but was reduced from a real-world use case in our app.
The current behavior
The object is retained by the
__reactFiber$...
property of the<button>
element:In our app, this behavior leads to a huge graph of objects from a previous screen/route of the app being retained when switching away from that screen.
The expected behavior
The state which is no longer current should be released.
The text was updated successfully, but these errors were encountered: