Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: React 18 doesn't show memory leak warnings #24468

Closed
bushblade opened this issue Apr 29, 2022 · 1 comment
Closed

Bug: React 18 doesn't show memory leak warnings #24468

bushblade opened this issue Apr 29, 2022 · 1 comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@bushblade
Copy link

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.

Screenshot_2022-04-29_14-47-45

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 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

@bushblade bushblade added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 29, 2022
@bushblade
Copy link
Author

Ah sorry guys, just found #24195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

1 participant