Introduction/Installation
Installation
Install the adapter together with the core. The core is a peer dependency: you import drivers,
defineList and the list params from it directly, so your app owns its version.
npm install @qubeejs/react @qubeejs/corepnpm add @qubeejs/react @qubeejs/coreyarn add @qubeejs/react @qubeejs/coreRequirements
Section titled “Requirements”| Package | Version | Why |
|---|---|---|
react |
^18.3.0 or ^19.0.0 |
The hooks use useSyncExternalStore, useTransition, useState, useRef, useEffect and context — stable in both majors. |
@qubeejs/core |
^1.4.1 |
1.3 added QubeeConfig.baseUrl and the list layer — defineList, readListState, buildListHref, buildListRequest — that the adapter builds on; 1.4 lets a list declare an input, which useQubeeList passes through, and 1.4.1 tells every list without one apart from those with one. |
Type declarations ship with the package; there is no @types/… package to add.
What you get
Section titled “What you get”- One main entry point, and one per integration. The hooks, the providers and their types come
from
@qubeejs/react. Each router adapter and each fetching integration is an entry point of its own —@qubeejs/react/react-router,@qubeejs/react/tanstack-router,@qubeejs/react/next,@qubeejs/react/tanstack-query,@qubeejs/react/swr— with its library as an optional peer dependency, so you install only what you import.@qubeejs/react/fetchholdsfetchQubeePage, for servers, loaders and scripts. - ES modules and CommonJS, with source maps and
sideEffects: false. Load the package one way throughout an app: the two formats are separate copies, so a provider reached withrequireis not seen by a hook reached withimport. - Zero runtime dependencies. React and the core are peers; nothing else is installed.
- A client boundary built in. The entry points that export hooks or components are marked
'use client', so a Next.js Server Component can import the package’s components without a wrapper file;@qubeejs/react/fetchand@qubeejs/react/tanstack-queryare not, so a Server Component can call what they export. Bundlers that have no client boundary leave the marker alone; Rollup-based ones, Vite among them, may print aMODULE_LEVEL_DIRECTIVEnotice as they do, which is harmless.
Keep the bundle small
Section titled “Keep the bundle small”Import the one driver you use — STRAPI_DRIVER, LARAVEL_DRIVER — rather than the DRIVERS
registry, so the other seventeen tree-shake out. The core docs measure the difference:
Bundle size ↗.
Versions
Section titled “Versions”@qubeejs/react follows Semantic Versioning. Every release is listed in the
changelog.