Codstak
    • Home
    • DSA
    • JavaScript
    • TypeScript
    • Node.js
    • React
    • More↓
      BlogReact PrepPricingDiscordNewsletterLeaderboard
    React challenge/easy

    Todo: Remove a Task

    Challenge workspace

    15-20 min
    Lists and formsPath 10/33
    ListsState & eventsConditional rendering

    Suggested first

    Todo: Toggle a Task

    Your workspace must pass its server-side browser checks to complete this challenge.

    Todo: Remove a Task

    Focus on taking one selected item out of state while preserving the rest.

    IDs already provided

    • todo-list contains the task rows.
    • todo-read and todo-walk identify the existing tasks.
    • remove-read and remove-walk identify their matching controls.
    • empty-state appears after the final task is removed.

    Requirements

    • Remove only the task whose ID was selected.
    • Keep every other task in the list.
    • Use an immutable array operation.
    • Show the supplied empty state when no tasks remain.

    Hints

    • filter returns only the items that match its condition.
    • Keep tasks whose ID is different from the selected ID.