React client-side mock-up question: managing state v.s localStorage
I’m creating a client-side only mockup of a gym-class management system. I have a models folder with javascript dummy user objects that will provide default user credentials and info. However, I want users to log in (using dummy credentials) and then be able to play around with the functionality by editing personal info, scheduling classes, etc. I do want persistent data across different sessions so im using localStorage as the “database”. The project is very small so I wasn’t concerned about the storage size limits. Right now, I have programmed it so that logging in sets both the global authorized user state and sets the localStorage with the user object and all of its properties.
I’ve can’t be able to make that the new task stand in task-box as a button after close and open the browser using localStorage
I’m very new learning React, however, I want to be able to scale a class-project using localStorage, saving the text into a button and when I refresh the browser that keep and, delete it when I want, since said button already is configured with a couple of actions, but I couldn’t.
Could you help me resolve this problem, please.
Why my state is empty after set it a local storage item?
I have a probleme with my state, i’m trying to get an item from local storage and set it into my state, but when i log my state it is empty and I ensure that local storage item has a value
LocalStorage with State
I’m using the following code to store cart data into local storage