skills/bun-guides-ecosystem-react/SKILL.md
Build a React app with Bun
npx skillsauth add jarle/bun-skills Bun Build a React app with BunInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Bun supports .jsx and .tsx files out of the box. React just works with Bun.
Create a new React app with bun init --react. This gives you a template with a simple React app and a simple API server together in one full-stack app.
# Create a new React app
bun init --react
# Run the app in development mode
bun dev
# Build as a static site for production
bun run build
# Run the server in production
bun start
Run bun dev to start the app in development mode. This will start the API server and the React app with hot reloading.
Run bun start to start the API server and frontend together in one process.
Run bun run build to build the app as a static site. This will create a dist directory with the built app and all the assets.
├── src/
│ ├── index.tsx # Server entry point with API routes
│ ├── frontend.tsx # React app entry point with HMR
│ ├── App.tsx # Main React component
│ ├── APITester.tsx # Component for testing API endpoints
│ ├── index.html # HTML template
│ ├── index.css # Styles
│ └── *.svg # Static assets
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── bunfig.toml # Bun configuration
└── bun.lock # Lock file
development
Using TypeScript with Bun, including type definitions and compiler options
development
Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers
testing
Learn how to use snapshot testing in Bun to save and compare output between test runs
testing
Learn about Bun test's runtime integration, environment variables, timeouts, and error handling