BeginnerCoder

Lesson 25 — Ultimate: todo app

Boss level: a complete feature

A real todo app needs state for the list and the input, adding with validation, toggling an item immutably (map to a new array and copy only the changed item), and a derived "remaining" count. Each item is an object like { text, done }, and the style changes when it is done.

setItems(items.map((x, j) => (j === idx ? { ...x, done: !x.done } : x)));

Why it matters: this is a full feature end to end — the same steps you will use for carts, inboxes and task boards.

Want it another way?
Task

Count the remaining items and make clicking an item toggle it. After adding A, B, C and clicking A: "2 left" and A is crossed out.

Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.

Keep going with React Foundations

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.