paint-brush
I Created an Alternative to React's useEffect Hookby@andrewcovenant
5,522 reads
5,522 reads

I Created an Alternative to React's useEffect Hook

by Andrei Făgădău2mDecember 28th, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The useOnUnmount() hook is a functional React alternative to ComponentWillUnmount that allows us to mutate values between renders so that it can be used outside the component. UseOnUpdate() is another useful hook for when we want to trigger an action when the component changes, and not when the state changes. The useEffect() will clean up the previous state before applying the next one. The hook can be found here: useOnUpdate(https://www.hackernoon.com/images/qKpeaoFMpkfgP9RP0ujjUyy9fa42-FB13bitbit-bit-p90vb)

Company Mentioned

Mention Thumbnail
featured image - I Created an Alternative to React's useEffect Hook
Andrei Făgădău HackerNoon profile picture
Andrei Făgădău

Andrei Făgădău

@andrewcovenant

👋 I am a Senior React.js & Node.js Developer / Contractor / Freelancer with 𝟲+ 𝘆𝗲𝗮𝗿𝘀 𝗼𝗳 𝗲𝘅𝗽𝗲𝗿𝗶𝗲𝗻𝗰𝗲.

Learn More
LEARN MORE ABOUT @ANDREWCOVENANT'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Andrei Făgădău HackerNoon profile picture
Andrei Făgădău@andrewcovenant
👋 I am a Senior React.js & Node.js Developer / Contractor / Freelancer with 𝟲+ 𝘆𝗲𝗮𝗿𝘀 𝗼𝗳 𝗲𝘅𝗽𝗲𝗿𝗶𝗲𝗻𝗰𝗲.

TOPICS

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