react
react copied to clipboard
Bug: memory leak, Initialized props are not released even though props are updated
React version:18.2.0
Steps To Reproduce
- Click the "Click Me" button multiple times
- Create heap snapshot on chrome and search for all objects with class name "Props"(test class name)
- 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

The expected behavior
Unused objects are released normally.