DEV Community

Discussion on: Incrementing State In Functional Components

Collapse
 
dance2die profile image
Sung M. Kim

setActiveStep(prevActiveStep => prevActiveStep - 1)

which wasn’t defined anywhere else.

I believe I saw that pattern on Twitter somewhere where it's used to rid of a dep in useEffect and I couldn't find that in React documentation either.

Maybe you can PR to the React documentation 😉