You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: "Clear" / "Reload" button in CodeSandbox does not reset user edits to original sample code #8657
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.
I would like to contribute to this issue. I'm interested in investigating the CodeSandbox reset behaviour and fixing it so that clicking Clear or Reload restores the original sample code.
Could you please confirm whether this issue is available for external contributions? I'd be happy to work on it.
Activity
Madhu-priya123 commentedon Nov 26, 2026
Hi,
I would like to contribute to this issue. I'm interested in investigating the CodeSandbox reset behaviour and fixing it so that clicking Clear or Reload restores the original sample code.
Could you please confirm whether this issue is available for external contributions? I'd be happy to work on it.
Thank you!
Fr00tL00ps515 commentedon Nov 26, 2026
Hi @Madhu-priya123, thanks for your interest!
There's already an open PR for this (#8668). You could review or test it, or look for another issue.