2022-07-01
2699
#react
Saleh Mubashar
121676
Jul 1, 2022 â‹… 9 min read

How to build a notes app with React and localStorage

Saleh Mubashar I'm an experienced web developer who uses his knowledge and experience to guide people looking to learn web dev and new technologies.

Recent posts:

A Guide To The React UseReducer Hook

A guide to the React useReducer Hook

The useReducer React Hook is a good alternative to tools like Redux, Recoil, or MobX.

Ejiro Asiuwhu
Oct 10, 2024 â‹… 13 min read
Using The Built-In SQLite Module In Node.js

Using the built-in SQLite module in Node js

Node.js v22.5.0 introduced a native SQLite module, which is is similar to what other JavaScript runtimes like Deno and Bun already have.

Amazing Enyichi Agu
Oct 10, 2024 â‹… 12 min read
Understanding and supporting zoom behaviors on the web

Understanding and supporting zoom behaviors on the web

Understanding and supporting pinch, text, and browser zoom significantly enhances the user experience. Let’s explore a few ways to do so.

Fimber Elemuwa
Oct 9, 2024 â‹… 7 min read
Comedy and tragedy masks symbolizing Playwright Extra's ability to extend Playwright with customizable plugins for both stealth and interactive browser automation tasks.

Playwright Extra: extending Playwright with plugins

Playwright is a popular framework for automating and testing web applications across multiple browsers in JavaScript, Python, Java, and C#. […]

Antonello Zanini
Oct 8, 2024 â‹… 9 min read
View all posts

3 Replies to "How to build a notes app with React and <code>localStorage</code>"

  1. That was a cool project, thanks. The only thing is, my localStorage was being empty after refreshing the page and all notes were going out.

    I changed the useEffect for getItem, following:

    //get the saved notes and add them to the array
    useEffect(() => {
    const data = JSON.parse(localStorage.getItem(“Notes”));
    if (data && data.length > 0 ) {
    setNotes(data);
    }
    }, []);

    And now it works.

Leave a Reply