Online Editors and Sandboxes

Nothing in this chapter needs a local install to try. A browser sandbox gives you a React 7,897 project in seconds and — more usefully — a URL. When you report a bug or share a snippet with a colleague, a link to a running reproduction saves everyone the "it works here" round trip; maintainers of React libraries routinely close issues that arrive without one.

Browser sandboxes for React work
Sandbox Where the code runs Best for
StackBlitz 38,726 In your browser, on WebContainers Full projects, instant boot
CodeSandbox 24,655 A container in the cloud Repos, branches, npm 2,036 scripts
CodePen In your browser, no Node Single-file snippets and demos
Replit 3,526 A container in the cloud Pairing and teaching

The interesting one technically is StackBlitz. Its WebContainers (https://webcontainers.io/) runtime brings Node.js 2,131 into the browser tab itself, so npm install and vite dev run on your own machine with no server involved: boot is instant and nothing you paste leaves the browser. CodeSandbox takes the opposite approach and gives you a real Linux container, slower to start but able to run anything Node runs, including an Express 24,430 server from Express.js.

The React documentation links straight to a React project on StackBlitz (https://stackblitz.com/fork/react 38,726 ) and a new CodeSandbox (https://codesandbox.io/s/new 24,655 ); add ?file=src/App.jsx to a shared link to open it on a particular file. For a quick snippet a sandbox beats the import-map page of React in an HTML Page.