Description

A note editor uses useReducer. Adding a note appends it to the list. Editing a note should update just that note's text. Editing always adds a duplicate instead of updating in place.

Anomaly

Click Edit on a note, change the text, click Save. The original note stays and a second copy with the new text appears below it. The list grows instead of updating.

Constraint
Fix only the EDIT case in the reducer
Do not change the ADD case or the component JSX
Hint
Consult the SenseiOnly for those truly stuck · Flip to reveal

The EDIT case in the reducer is pushing a new item into the array instead of mapping over the existing ones and replacing only the matching note.

Loading editor…
Correct Solution
Loading...
Expected OutputGoal State
Your OutputLive