Josh Comeau personal blog

Persisting React State in LocalStorage

A common thing in React development is that we want to store a bit of React state in localStorage, and re-initialize from that value on the next page-load. This quick tutorial shows you how we can build a custom hook that does exactly this!
Points
137
HN comments
64
Submissions
1
Cited by
0 commenters

Web & FrontendSoftware Engineering2020

On Hacker News

SubmittedTitle on HNPointsComments
Feb 28, 2020Persisting React State in LocalStorage by joshwcomeau13764

More from Josh Comeau

All 32 posts →

Related posts from the same era