Practice Lab

react Skills Challenge

Master your react expertise with interactive coding missions and real-time validation.

EasyHooks & State

React Todo List (CRUD)

Implement a reducer for a Todo list. Handle 'ADD', 'TOGGLE', 'UPDATE_TEXT', and 'DELETE' actions. State is an array of objects: { id, text, completed }.

Guidelines

  • No global variables
  • No side effects
  • No external dependencies

Example Scenario

todoReducer([{ id: 1, text: 'Task 1', completed: false }], { type: 'UPDATE_TEXT', payload: { id: 1, text: 'Updated Task' } }) -> [{ id: 1, text: 'Updated Task', completed: false }]
Loading...