79441975

Date: 2025-02-15 17:32:52
Score: 0.5
Natty:
Report link

It is always good practice to clean up any memory leaks like timer apis, event handlers or any other external api which can potentially lead to any kind of memory leaks. But In case of local state, I believe there is not need to clean that manually. When the component unmounted, it's local variables are un-referenced Garbage collector will automatically detect un-referenced memory and clean that up (using algorithms like mark-and-sweep). There is no need to manually do that.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: Muhammad Saqib