[Bug]: "Clear" / "Reload" button in CodeSandbox does not reset user edits to original sample code
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 11.8k
- Forks
- 7.9k
- Ø Merge
- 1 T. 11 Std.
- Gemergte PRs (30 T.)
- 11
Beschreibung
Summary
Component: Interactive Code Sandbox
Steps to Reproduce:
- Navigate to the "Treat state as read-only" section in the React documentation.
- Modify the sample code inside the sandbox. Change:
position.x = e.clientX;
position.y = e.clientY;
to:
const p = { x: e.clientX, y: e.clientY };
setPosition(p);
3.Observe that the red dot starts following the cursor as expected.
4.Click the "Clear" or "Reload" button on the sandbox to undo the edits and restore the original code sample.
Expected Result:
The sandbox should revert to the original, unedited sample code (position.x = e.clientX), and the red dot should stop following the cursor.
Actual Result:
The red dot continues to follow the cursor despite triggering a reset.
Page
https://react.dev/learn/updating-objects-in-state
Details
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Reset-Verhalten im Abschnitt "Treat state as read-only" von react.dev/learn/updating-objects-in-state nachzubilden, und verfolge anschließend den Reset-Ablauf von Interactive Code Sandbox. Als erledigt gilt die Aufgabe, wenn Clear oder Reload den ursprünglichen Beispielcode wiederherstellt und der rote Punkt dem Cursor nicht mehr folgt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, react
- Bereich
- documentation
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 68/100