DEV Community

Discussion on: Writing a custom react hook that persists to local storage

Collapse
 
mcrowder65 profile image
Matt Crowder

Yeah! Before I wrote this article, I actually wasn't using useEffect at all! And I was just invoking whenever the setter was invoked: github.com/mcrowder65/mooks/commit...

Context is great, but underneath, it would still need to do useState. I would be happy to provide an example on how to do useContext.