> ## Content Index
> Fetch the complete content index at: https://reactpractice.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# Add persistence to local storage for an existing app
- URL: https://reactpractice.dev/exercise/add-persistence-to-local-storage-for-an-existing-app/
- Published: 2024-04-19T10:19:35.000Z
- Updated: 2026-06-01T01:58:13.000Z
- Author: Corina Udrescu
- Tags: Local storage, #corina-2, Exercises, Leetcode React, #Import 2026-06-09 12:07

Here's a simple shopping list app - [https://codesandbox.io/p/sandbox/shopping-list-local-storage-76f46c](https://codesandbox.io/p/sandbox/shopping-list-local-storage-76f46c?ref=reactpractice.dev). Right now if the user refreshes the page, all the data is lost.  
Improve the app by saving the data to local storage, so the user doesn't lose his items.

Acceptance criteria:

- When the user changes the items in the shopping list, the list is updated in local storage as well
- When the user refreshes the page, the items are still there

Notes:

- the app doesn't need to work across multiple tabs (but you can give it a shot if you want!)
- you don't need to create a custom hook (but you can try [this other practice](https://reactpractice.dev/exercise/create-a-custom-hook-that-allows-saving-items-to-the-local-storage/) exercise if you want to try that)

💡

Ready to check your work?  
[Become a member](https://reactpractice.dev/become-a-member/) and get access to the [official solution](https://reactpractice.dev/solution/check-your-work-add-persistence-to-local-storage-for-an-existing-app/) and the comments section for feedback and discussion.