react icon indicating copy to clipboard operation
react copied to clipboard

Bug: memory leak, Initialized props are not released even though props are updated

Open j2wei opened this issue 3 years ago • 0 comments

React version:18.2.0

Steps To Reproduce

  1. Click the "Click Me" button multiple times
  2. Create heap snapshot on chrome and search for all objects with class name "Props"(test class name)
  3. Check the number of Props classes with an id property of 1

Link to code example: codepen link with class component codepen link with function component

The current behavior

The Props object with the id property of 1 is not released image

The expected behavior

Unused objects are released normally.

j2wei avatar Jul 29 '22 07:07 j2wei