Lesson 17 — Mini project: todo list
Your first small app
A todo list combines everything so far: a controlled input for the text, state for the list, and a click handler that adds an item. Never push into the state array — create a new array with spread, then clear the input so the user can type the next item.
setTags([...tags, newTag]); // new array: React sees the change
// tags.push(newTag) ← same array: React may not re-render
Why it matters: this add-to-list flow appears in comments, carts, playlists and chats.
Finish add(). Typing Milk → Add, then Eggs → Add should show both in the list and empty the box.
A quick 3-question quiz on this lesson — instant feedback.
Ready for more? Optional paid resources that pick up where this lesson leaves off.
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.
Project-based React Foundations courses if you want a structured paid path after the free lessons. Wait for a sale — prices drop often.
Browse on Udemy →Search Amazon for React Foundations books — check the publication year so the examples match current versions.
Search Amazon →