Getting started
Installation
Install @raf-query/react with npm, pnpm, Yarn or Bun.
Apps install one package, @raf-query/react. It re-exports everything from @raf-query/core, so you never import core directly.
npm install @raf-query/react
# or
pnpm add @raf-query/react
# or
yarn add @raf-query/react
# or
bun add @raf-query/reactRequirements
- React 19.2 or newer. raf-query reads data with
use()and relies on transitions, Actions anduseOptimistic. - Node.js 22 or newer for server rendering.
One entry point
Everything comes from @raf-query/react: the hooks, the client, dehydrate and hydrate for SSR without an integration, HydrationBoundary and the devtools. An app bundles only what it imports, so hydration and the devtools cost nothing until it uses them.
TanStack Start and TanStack Router apps also import setupRouterIntegration from @raf-query/react/tanstack-router, the one subpath. It needs @tanstack/react-router, an optional peer, and gives the server and the browser different code. React Server Components apps, such as the Next.js App Router, and React Router Framework Mode need no integration entry.
TypeScript
raf-query is written in TypeScript and ships its types. Query data, inputs and errors are inferred from your query factories, so most apps never write a type argument. TypeScript 5.5 or newer with strict is recommended.
Next, build your first page in the quick start.