I Created an Alternative to React's useEffect Hookby@andrewcovenant
4,785 reads

I Created an Alternative to React's useEffect Hook

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

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

@andrewcovenant

Andrei Făgădău


Receive Stories from @andrewcovenant

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

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa