Avoid Memory Leaks and Improve Performance with Cleanup Functions in React’s useEffect Hook

Side Effects — explained with examples.

L Javier Tovar
JavaScript in Plain English
4 min readJul 7, 2022

--

Photo by Towfiqu barbhuiya on Unsplash

If you are starting to learn React or already have some time using this library, surely, you have come across some errors or warnings related to asynchronous functions, especially using the hook useEffect.

--

--