If you're building custom server-rendered React apps with Bun instead of reaching for Next.js or Remix, this gives you the patterns. It covers both renderToString and streaming SSR with renderToReadableStream, client hydration setup, and how to wire up Bun.serve with static file handling. The data fetching examples show passing initial state through window globals, which works but isn't elegant. You also get a basic client-side router and dev server with file watching. Honestly, this is most useful when you need SSR but want to stay light on dependencies or you're already invested in the Bun ecosystem. For anything beyond a handful of routes, you'll probably want an actual framework.

skills.sh installs
330
GitHub stars
248
last updated
Aug 21, 2026

Install

$ npx -y skills add secondsky/claude-skills --skill bun-react-ssr --agent claude-code

Installs into .claude/skills of the current project.

Files

Bun React SSR

Build custom server-rendered React applications with Bun.

Quick Start

# Initialize project
mkdir my-ssr-app && cd my-ssr-app
bun init

# Install dependencies
bun add react react-dom
bun add -D @types/react @types/react-dom

Basic SSR Setup

Server Entry

// src/server.tsx
import { renderToString } from "react-dom/server";
import App from "./App";

Bun.serve({
  port: 3000,
  async fetch(req) {
    const url = new URL(req.url);

    // Serve static files
    if (url.pathname.startsWith("/static/")) {
      const file = Bun.file(`./public${url.pathname}`);
      if (await file.exists()) {
        return new Response(file);
      }
    }

    // Render React app
    const html = renderToString(<App url={url.pathname} />);

Sponsors

Details

Repository
github.com/secondsky/claude-skills
Categories
Frontend Development, Backend & APIs
First seen
Jun 3, 2026

More from secondsky/claude-skills

All 146
1jackspace avatarbase-ui-reactjackspace/claudeskillzbase ui react259skills.sh installs
2duyet avatarreact-nextjs-patternsduyet/claude-pluginsreact nextjs patterns231skills.sh installs
3akillness avatarui-component-patternsakillness/oh-my-skillsui component patterns171skills.sh installs
4vuejs-ai avatarvue-jsx-best-practicesvuejs-ai/skillsJSX syntax in Vue (e.g., class vs className, JSX plugin config).11.9Kskills.sh installs
5affaan-m avatarui-to-vueaffaan-m/eccUse when the user has UI screenshots or design exports that need batch conversion into Vue 3 components, especially with Vant, Element Plus, or Ant Design Vue.5.4Kskills.sh installs
6paulrberg avatartailwind-csspaulrberg/agent-skillsUse for Tailwind v4 styling: add/fix classes, configure or migrate Tailwind, use tailwind-variants, or tw-animate-css.3Kskills.sh installs