Online React Compiler
Write, run, and share code snippets - no setup required.
Run React JS code online and watch it render
A free online React compiler and playground. Edit App.jsx and the preview next to it re-renders a moment after you stop typing: components, props, useState, useEffect and every other hook work as they do in a real app. There is no npm install, no Vite project and no local server to start.
Your JSX is compiled in your browser with esbuild, the same build that runs the live preview in Coddy's React lessons, against React 19. The project is four files, laid out like a Vite app: App.jsx, styles.css, main.jsx and index.html. Nothing is sent to a server, so the preview keeps up with your typing.
What makes this React online compiler useful
- Live preview: the app rebuilds and re-renders a moment after you stop typing, and the refresh button (or Ctrl+Enter) remounts it from scratch to reset its state.
- Real React 19 with every hook:
useState,useEffect,useReducer,useRef,useContext,useMemoand your own custom hooks. - Build errors point at the file, line and column, in a readable error page where the preview would be, so a missing brace never leaves a blank screen.
- A console under the preview shows
console.log, warnings and runtime errors from your components. - Your code is saved in your browser as you type. Open the preview in a new tab, or copy and download any file to move it into a real project.
What you can build in the React online compiler
- A to-do list: a controlled
<input>,useStatefor the list, and.map()rendering one<li>per task with akey. - A counter or a timer, to see how
useStateanduseEffectwith a cleanup function behave. - Components that talk to each other: lift state up to a parent and pass values and callbacks down as props.
- A theme switcher with
createContextanduseContext, styled fromstyles.css.
Online React compiler FAQ
Is the online React compiler free?
Do I need Node.js, npm or Vite to run React here?
npm create vite or start a dev server. Any modern browser works, on Windows, macOS, Linux or a Chromebook.Can I import npm packages?
react and react-dom/client, and your own files with a relative path such as import App from './App.jsx'. Other npm packages such as React Router or Axios are not available, so the playground is best for components, hooks and state rather than a full app with dependencies.