Learn how to work with LocalStorage in React Project to store Settings directly in the browser. This approach will enable the app to remember user information between sessions without the need for a backend.
Source code: https://github.com/DzmitryUr/weather-... (the whole Weather App project)
Build a Weather App Video: • Build a React JS Weather App with Vite, Ax...
⌚️Timestamps:
0:00 Why do we need to store the Settings
0:50 Store mode setting with localStorage.setItem()
2:40 Get mode setting with localStorage.getItem()
4:19 Save unit setting to Local Storage
7:14 Retrieve unit setting from Local Storage in useEffect hook
8:50 Final Testing of the Weather App Settings with LocalStorage
If you found this video helpful, please give it a thumbs up, subscribe for more React tutorials, and leave a comment with any questions or topics you’d like covered in future videos. Thank you for watching!
Tags:
ReactJS, LocalStorage, JavaScript, Web Development, Frontend Development, React Tutorial, State Management, LocalStorage React