Mastodon hachyterm.io

I’m still trying to figure out what causes a memory leak with my useEffect custom React Hook.
I read tons of articles (I recommend Dan Abramov’s) but I haven’t found the solution.

My custom data fetching hook (with an asynchronous API call) messes with state although the component is unmounted.

The obvious solution is to add a cleanup function. But my implementation (see “Abort Data Fetching in Effect Hook” from this article) doesn’t work.

I’ve learned a lot in the last days about useEffect, so I hope my persistence will pay off.