© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Anand Reddy Rikka
A Continuous Learner and passionate coder
What are the different options available to persist state when we refresh React application?
Ankit Singhaniya
Full Stack Developer
You can simply save the state in the local storage and then read it back to the state in ComponentDidMount
ComponentDidMount
j
stuff ;)
github.com/rt2zz/redux-persist that's what I've used. I would recommend an action-buffer so there are no race-conditions.
Hardik Modi
There are many libraries available to do the same. I recommend you to use react-persist easy to use. Maximum of 5 to 6 lines of code will save your state over refresh. Specifically if you don't like to use local storage like me.
Hardik Modi yes but why don't you leave this as a general comment?
Ankit Singhaniya
Full Stack Developer
You can simply save the state in the local storage and then read it back to the state in
ComponentDidMount