paint-brush
Cleanup Functions in React’s UseEffect Hook — Explained with examplesby@ljaviertovar
47,752 reads
47,752 reads

Cleanup Functions in React’s UseEffect Hook — Explained with examples

by L Javier Tovar6mDecember 1st, 2022
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

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. When I was learning the functionality of this hook, I could not understand the reason to use the return in this function since in most cases it is not necessary to use it and React works perfectly well without it.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - Cleanup Functions in React’s UseEffect Hook — Explained with examples
L Javier Tovar HackerNoon profile picture
L Javier Tovar

L Javier Tovar

@ljaviertovar

☕ FrontEnd engineer 👨‍💻 Indie maker ✍️ Tech writer

L O A D I N G
. . . comments & more!

About Author

L Javier Tovar HackerNoon profile picture
L Javier Tovar@ljaviertovar
☕ FrontEnd engineer 👨‍💻 Indie maker ✍️ Tech writer

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite