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: Memory leak for input element in react 18.2.0 and 16.14.0 #27289

Closed
mshmyw opened this issue Aug 27, 2023 · 2 comments
Closed

Bug: Memory leak for input element in react 18.2.0 and 16.14.0 #27289

mshmyw opened this issue Aug 27, 2023 · 2 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@mshmyw
Copy link

mshmyw commented Aug 27, 2023

React version: 16.14.0 and 18.2.0

Steps To Reproduce

I can give a demo more obvious, the demo: https://codesandbox.io/s/admiring-khayyam-3s64gq?file=/src/App.tsx

Steps To Reproduce:

  1. a simple demo can be found Here: https://codesandbox.io/s/admiring-khayyam-3s64gq?file=/src/App.tsx
  2. running GC and Take a heap snapshot
    image
  3. Click 'open Modal click for test memory leak (has large input items)' and open modal
  4. focus any input item
    image
  5. close modal
  6. refresh state for click 'refresh state '
  7. running GC and Take a heap snapshot
    image

and after that you can found large detached input element exist

Link to code example:
https://codesandbox.io/s/admiring-khayyam-3s64gq?file=/src/App.tsx

The expected behavior

hope some one can help resolve this

@mshmyw mshmyw added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Aug 27, 2023
@MarceloSpessoto
Copy link

Hello mshmyw, this behavior is indeed very weird. I will try to see what is happening and see if I can fix it

@sophiebits
Copy link
Collaborator

Will comment on #26069.

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

3 participants