re: The Definitive React Hooks Cheatsheet VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi Antonin, Thanks for writing this. I think it's very useful. I have one comment regarding your useUser hook. I think it's important to "cancel" ...
 

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.

 

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

code of conduct - report abuse