react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

fix(Sandpack): prevent phantom browser history entries on scroll (#8047)

Open DeveloperViraj opened this issue 3 months ago • 2 comments

Fixes #8047

This PR resolves an issue where scrolling down documentation pages (such as “Separating Events from Effects”) caused multiple phantom browser history entries, requiring multiple back button presses to navigate away.

  • Ensures Sandpack iframe bundler registers only once per mount.
  • Prevents repeated history pushes from iframe reloads.
  • Verified locally on Chrome and Firefox.

DeveloperViraj avatar Oct 06 '25 18:10 DeveloperViraj

Size changes

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 110.54 KB (🟡 +1 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

github-actions[bot] avatar Oct 06 '25 18:10 github-actions[bot]

I think this issue is related to codesandbox/sandpack#992, not react.dev site...

carnoxen avatar Nov 10 '25 00:11 carnoxen