> ## 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.

# Create a custom hook that allows saving items to the local storage
- URL: https://reactpractice.dev/exercise/create-a-custom-hook-that-allows-saving-items-to-the-local-storage/
- Published: 2023-02-02T07:47:41.000Z
- Updated: 2026-06-01T01:58:07.000Z
- Author: Corina Udrescu
- Tags: Custom hooks, #corina-2, Exercises, Leetcode React, Local storage, #Import 2026-06-09 12:07

You will start from an **existing Todo List app** (yes, another one!) built with React. It works great - users can add / remove items - but there is only one problem - every time the page is refreshed, all the items are lost.

Your task will be to implement **persistence** \- the list of tasks should be saved to local storage, so that the user can continue where they left off after closing and reopening the browser window.

You can start from this starter repo on Github, containing the todo list app: [https://github.com/reactpractice-dev/local-storage-hook](https://github.com/reactpractice-dev/local-storage-hook?ref=reactpractice.dev)

Implementation notes:

- Use a custom hook to encapsulate the saving to local storage logic

💡

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/tutorial-create-a-custom-hook-that-allows-saving-items-to-the-local-storage/) and the comments section for feedback and discussion.