DEV Community

Discussion on: Do you need a State Management Library?

Collapse
 
jamesthomson profile image
James Thomson

I just store the state inside localStorage and access it whenever I want but sometimes it bothers me that user can manipulate the state by injecting their own JS script inside the console

Just to be clear, this is the case regardless of if you're using localStorage or a state management lib. Anything on the client should be considered accessible to the user.

Collapse
 
zaimazhar97 profile image
zaimazhar97

I've been bugging myself for quite some time about this. Now I can stop concerning too much about keeping state in localStorage.

Thank you. 🙂

Thread Thread
 
jamesthomson profile image
James Thomson

Yes, don't worry about it unless it's sensitive information - that should never be stored on the client.