Back to projects
Projectbeginner 9 steps ~60 min

Todo App with React

The classic first React project, done right: immutable updates, stable keys, a tested reducer, filters in the URL, inline editing with focus management, accessible controls, and storage that survives bad data.

What you'll build

A keyboard- and screen-reader-friendly todo app with URL filters, inline editing, and safe persistence.

  • React
  • useReducer
  • URL state
  • focus management
  • localStorage
Project briefrequirements and design decisions

Requirements

  • Add, complete, and delete todos
  • Filter by all, active, and done
  • Todos survive a page refresh
  • Empty input can't create a todo

Architecture decisions

  • One todos array is the source of truth; counts and filtered lists are derived
  • Filter is separate UI state, not a copy of the list
  • Persistence is a side effect in useEffect, isolated from rendering

Stretch goals

  • Edit a todo inline with Enter to save and Esc to cancel
  • Keep the filter in the URL so it's shareable
  • Drag to reorder

Production checklist

  • Handle corrupted or old localStorage data safely
  • Keyboard and screen-reader support for the list and filters
  • Unit tests for the reducer logic

1What we're building

The todo app is the classic first React project, and that's exactly why it's worth doing well. Most versions online have subtle bugs: they mutate state, use array indexes as keys, lose keyboard focus, crash on old saved data, and can't be used without a mouse.

You'll build one that gets those details right:

  • Add, complete, edit, and delete todos
  • Filters (All, Active, Done) that live in the URL, so the back button works
  • Inline editing: double-click or press the ✎ button; Enter saves, Escape cancels
  • Saved in localStorage, and safe against corrupted data
  • Fully usable with a keyboard and a screen reader

You'll start with everything in App.jsx, then move the logic into a reducer you'll test, the way real apps grow:

1App.jsx state and wiring 2TodoItem.jsx one todo: checkbox, label, edit, delete 3todos.js pure logic: the reducer and the filter 4Filters.jsx the filter links 5storage.js load and save, defensively 6styles.css

What you'll learn: controlled inputs, immutable updates, stable keys, derived state, useReducer, URL state, focus management, and defensive persistence.

Each step has a task in the editor, a live preview, and a solution you can load if you're stuck.

Todo App with React project | Bloom