DEV Community

Discussion on: React: Redux and localStorage

Collapse
 
rahulmandyal profile image
RahulMandyal

could you please explain me from where i am getting access to state variable that you are accepting as a parameter . But When you are calling this stateToLocalStorage function you are not passing any kind of arguments into it . So how this is persisting all the state data

Collapse
 
link2twenty profile image
Andrew Bone • Edited

It's a redux store. The state is stored in the store and the store is stored in local storage.

If you don't need redux I've written an article about just using storage too.