DEV Community

Discussion on: The Definitive React Hooks Cheatsheet

Collapse
 
guico33 profile image
guico33

In this case there's no memory leak though.
It's simply a warning as updating the state will effectively do nothing after the component has been unmounted.

Collapse
 
juliang profile image
Julian Garamendy

Ah. I see your point. I suppose the dangling reference to the component gets garbage-collected after the promise resolves and state is updated?