React needs no setup: no project, no build step, no install. The React Starter comes with React 19 and runs offline.
Open the React Starter
Click React on the Home screen. With a Snippet open, click + at the end of the tabs and choose React.
Wait a moment. With Run as you type on, as it is at first, the Starter runs by itself, and its page appears beside the code: a counter with − and + buttons.
A small demo, so there is something to run. Clear it and write your own.
import { useEffect, useState } from "react"
JSXCSS
1⌄import{useEffect,useState}from"react"
2⌄import{createRoot}from"react-dom/client"
3⌄
4⌄// One component, rendered into the markup's #root.
The component in the JSX Part: useState holds the count, useEffect prints it.
The page is a real page in Chromium, in a process of its own. To run the code yourself at any time, press ⌘↵ or Ctrl+Enter.
Read the page’s console
What the page prints with console.log appears in the Console tab, beside Page. The Starter prints count each time it changes, so each click adds a line. Switching tabs doesn’t reload the page.
import { useEffect, useState } from "react"
JSXCSS
1⌄import{useEffect,useState}from"react"
2⌄import{createRoot}from"react-dom/client"
3⌄
4⌄// One component, rendered into the markup's #root.
Each click changes the count on the page and prints it in the console.
To give the page the whole window, choose Output only in the Layout menu, at the right end of the tab strip.
The pictures show JSpark on a Mac. On Windows, the window buttons are at the top right, the menus are in theMenu button at the left end of the tabs, and shortcuts use Ctrl where a Mac uses ⌘. The rest works the same way.
May this site use Google Analytics? It sets cookies to count visits and see which pages are read. If you say no, nothing is loaded from Google. More in Privacy.