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
In React 17 if you tried to update state of a component that had been
removed/unmounted then you would get a warning about it letting you know you had
a memory leak.
In React 18 this no longer happens.
I can't find out if this is intended or not.
If it is intended then does React now 'fix' memory leaks somehow and where is this documented?
My instinct says that there should still be a warning.
To reproduce:-
run the CodeSandbox demo's or clone the demo repos and run
click the button to remove the component before the timeout finishes
In React 17 if you tried to update state of a component that had been
removed/unmounted then you would get a warning about it letting you know you had
a memory leak.
In React 18 this no longer happens.
I can't find out if this is intended or not.
If it is intended then does React now 'fix' memory leaks somehow and where is this documented?
My instinct says that there should still be a warning.
To reproduce:-
In React 18 you will see no warning.
In React 17 you will see a warning.
React 17 Demo on CodeSandbox
Repo for React 17 demo
React 18 Demo on CodeSandbox
Repo for React 18 demo
The text was updated successfully, but these errors were encountered: