Bookmark this page

React Playground

Edit each snippet below and click "Execute" to see it run in one click.

Basic Components

Creating a Functional Component

Basic setup of a React component (no top-level imports).

Props Usage

How props are passed into components.

Hooks

useState Hook: manage state in functional components.

useEffect Hook: side effects / lifecycle in functional components.

Render Example

Render a component that modifies the DOM at #root.