https://github.com/toss/suspensive
All-in-one for React Suspense — ErrorBoundary with shouldCatch, SSR-safe Suspense, Delay, and more
https://github.com/toss/suspensive
async errorboundary react react-query ssr suspense suspensive
Last synced: 18 days ago
JSON representation
All-in-one for React Suspense — ErrorBoundary with shouldCatch, SSR-safe Suspense, Delay, and more
- Host: GitHub
- URL: https://github.com/toss/suspensive
- Owner: toss
- License: mit
- Created: 2022-11-16T14:53:28.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-04-14T01:09:00.000Z (18 days ago)
- Last Synced: 2026-04-14T02:28:44.404Z (18 days ago)
- Topics: async, errorboundary, react, react-query, ssr, suspense, suspensive
- Language: TypeScript
- Homepage: https://suspensive.org
- Size: 509 MB
- Stars: 1,009
- Watchers: 2
- Forks: 96
- Open Issues: 44
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
## What is Suspensive?
React gives you Suspense, lazy, and an interface to build Error Boundaries — but using them in real applications reveals gaps. **Suspensive fills those gaps** with declarative components and hooks.
```tsx
import { Delay, ErrorBoundary, ErrorBoundaryGroup, Suspense } from '@suspensive/react'
const Page = () => (
{({ reset }) => Reset All}
}
>
{({ isDelayed }) => }
}
>
)
```
- **`shouldCatch`** — catch only specific error types, let others propagate
- **`ErrorBoundaryGroup`** — reset multiple error boundaries at once, no prop drilling
- **`clientOnly`** — SSR-safe Suspense that avoids hydration mismatches in Next.js
- **`Delay`** — prevent flash-of-loading-state with render props for smooth fade-in
- **`reset`** — built into the fallback props, no external state needed
## Packages
| Package | Description | Version |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [@suspensive/react](https://suspensive.org/docs/react/motivation) | Suspense, ErrorBoundary, ErrorBoundaryGroup, Delay, ClientOnly | [](https://www.npmjs.com/package/@suspensive/react) |
| [@suspensive/react-query](https://suspensive.org/docs/react-query/motivation) | SuspenseQuery, SuspenseInfiniteQuery, Mutation, PrefetchQuery | [](https://www.npmjs.com/package/@suspensive/react-query) |
| [@suspensive/jotai](https://suspensive.org/docs/jotai/motivation) | Atom, AtomValue, SetAtom for Jotai integration | [](https://www.npmjs.com/package/@suspensive/jotai) |
| [@suspensive/codemods](https://suspensive.org/docs/codemods/motivation) | Automated migration codemods | [](https://www.npmjs.com/package/@suspensive/codemods) |
## Key Features
- **``** with `shouldCatch` — catch only the errors you want ([comparison with react-error-boundary](https://suspensive.org/docs/react/comparison))
- **``** — reset multiple error boundaries at once, no prop drilling
- **``** with `clientOnly` — SSR-safe Suspense that just works in Next.js
- **``** — declarative data fetching as JSX, no hook constraints
- **``** — prevent flash-of-loading-state UX issues
- **``** — set global default fallbacks for all components
## Getting Started
```bash
npm install @suspensive/react
```
Visit **[suspensive.org](https://suspensive.org)** for full documentation.
[English](https://suspensive.org/en) | [한국어](https://suspensive.org/ko)
## Contributors
Read our [Contributing Guide](./CONTRIBUTING.md) to familiarize yourself with Suspensive's development process, how to suggest bug fixes and improvements, and the steps for building and testing your changes.
MIT © Viva Republica, Inc. See [LICENSE](./LICENSE) for details.