[Bug]: "Clear" / "Reload" button in CodeSandbox does not reset user edits to original sample code
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 11.8k
- Fork
- 7.9k
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 11
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện hành vi reset trong phần "Treat state as read-only" của react.dev/learn/updating-objects-in-state, sau đó lần theo luồng reset của Interactive Code Sandbox. Được xem là hoàn tất khi Clear hoặc Reload khôi phục mã mẫu ban đầu và chấm đỏ không còn đi theo con trỏ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, react
- Lĩnh vực
- documentation
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Sôi nổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 68/100