Skip to content
TanStack

Redact

For the love of React, and smaller bundles.

We love React, and we want to keep writing it. Redact is an alternative runtime for React apps, with a smaller footprint and synchronous rendering. Keep your components, hooks, and imports, and try it with one Vite plugin.

vite.config.ts
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import { redact } from '@tanstack/redact/vite'

export default defineConfig({
  plugins: [react(), redact()],
})

Still writing React.

React's component model is the reason we built this. Redact keeps that familiar way of building apps, including server rendering, Fast Refresh, and React DevTools, while exploring how small the runtime underneath it can be.

We trade concurrent scheduling for a smaller, synchronous runtime. Streaming SSR, hydration, and Suspense are still on board.

API differences ↗
Counter.tsx
import { useState } from 'react'

export function Counter() {
  const [count, setCount] = useState(0)
  return (
    <button onClick={() => setCount(count + 1)}>
      Clicked {count} times
    </button>
  )
}

How small do you want to go?

Leave out class components if you don't use them, drop hydration if you're rendering everything on the client, or start with nano and build up from there. Every optional feature starts off, you choose what comes back.

Feature selection
// A client-rendered app without class components
redact({
  features: { hydration: false, classComponents: false },
})

// All optional features off, then context enabled
redact({ preset: 'nano', features: { context: true } })

Keep your DevTools, too.

Dig through your components and hooks, tweak props and state, and find out what's rendering with the React DevTools you already use.

Debugging tools belong in development, so we leave them out of your production build. All of this adds zero bytes to what your users download.

React DevTools support ↗

Partners

Gold
Railway
Vercel
Lovable
Netlify
CodeRabbit
Cloudflare
Render
Silver
AG Grid
OpenRouter
SerpApi
Clerk
WorkOS
Bronze
Sentry
Prisma
Scarf
Unkey
OSS Sponsors

Sponsors get special perks like private discord channels, priority issue requests, and direct support!