Command Palette

Search for a command to run...

Hectal
Phase 27: Capstone: Build a Complete App
React · Exercise 2 of 6 PreviousNext
Intermediate

Milestone 2: add, edit, move and delete with a reducer

The components already dispatch actions through context, but tasksReducer ignores them. Write the four cases so the board works.

added adds { id, title, status: "todo", priority: "medium" } at the end; edited changes a title; moved changes a status; deleted removes a task. Never change the old array or task objects: return new ones.

The page uses: the input #new-title (label New task) with an Add button, and buttons labelled Move <title> left, Move <title> right, Edit <title> and Delete <title> on each card. Editing shows an input labelled New title for <title>; Enter saves.

What Check tests

  1. Adding Ship it puts it in To do
  2. An empty title adds nothing
  3. Move right sends Add a reducer to Doing
  4. Editing renames Plan the board to Plan v2
  5. Delete removes Ship it
  6. The reducer copies instead of changing the array

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.