reactjs / reactjs/react.dev

[Bug]: "Reset state" on the playgrounds UX is confusing

Open
#7,848 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug: unconfirmed
Dominant language
JavaScript
Stars
11.8k
Forks
7.9k
Avg merge
1d 11h
Merged PRs (30d)
11

Description

Summary

If you want to reset the React state of a playground, but not the code, it's very unclear how to do so.
The only way I found is clicking on "Reset", which triggers a popup saying "Reset all your edits too?" and then pressing "Cancel". This will successfully reset the state but not the code. However there are two issues with that:

  1. It's not clear at all that this is the proper way to do so. Should there be two buttons instead?
  2. UX itself is counter-intuitive:
    a. The question is "Reset all your edits too?", which is a yes/no question, but the options are "Ok" or "Cancel"
    b. Normally if you press "Cancel" on a confirmation modal, it should cancel the original action altogether, but here is applies the action partially (reset the state but not the edits)
Page

https://react.dev/learn/separating-events-from-effects#challenges

Details

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the linked Separating Events from Effects challenge page and reproduce the playground's Reset flow. Review how the state-only reset and edit-reset choices are presented, then make the available actions and confirmation wording unambiguous. Done means users can tell how to reset React state without resetting code and understand what each option will do.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
design, documentation, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.