[Bug]: "Clear" / "Reload" button in CodeSandbox does not reset user edits to original sample code
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず react.dev/learn/updating-objects-in-state の "Treat state as read-only" セクションでリセット動作を再現し、次に Interactive Code Sandbox のリセットフローを追跡します。Clear または Reload で元のサンプルコードが復元され、赤い点がカーソルを追わなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 活発
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 68/100