Description

A name editor lets the user rename items in a list and undo the last change. Renaming works correctly — the new name appears immediately. Clicking Undo should restore the previous name but instead the name stays as the edited version.

Anomaly

Click Edit on any item, type a new name, click Save — the name updates correctly. Click Undo — the name does not revert. The original name is gone.

Constraint
Fix must create a new object for the edited item — do not mutate the item in place
Do not remove the undo feature or the history state
Hint
Consult the SenseiOnly for those truly stuck · Flip to reveal

When you save a snapshot to history before editing, check whether you are saving a copy of the data or a reference to the same objects. If the history and the current list share the same object references, editing one edits both.

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