react 18.3+ · ssr-safe · zero runtime deps

Hook the query.
Not the boilerplate.

@qubeejs/react connects @qubeejs/core to React. useQubeeList keeps a list's query in the page URL, through your router, and useQubeeQuery fetches the page it asks for. A hook gives a component its own query builder, and a provider shares one across a subtree.

These pages cover only what the adapter adds. Drivers, filters, the builder API and the list layer — defineList, its params, its hrefs — are documented once, in the qubeejs core docs ↗.

Get startedAdapter API
The qubee bee, in React blue

Store-backed hooks

useQubee and useQubeeContext read the core store through useSyncExternalStore: a new snapshot per write, no tearing, and a server snapshot, so client components render on the server too.

The URL is the state

useQubeeList reads a list from the page URL and writes it back through your router — browser history, React Router, TanStack Router or the Next.js App Router: at most one navigation per change, a draft that keeps inputs responsive while a search debounces, and a back button that simply works.

Fetching included

useQubeeQuery fetches the page a list asks for, once per navigation, through fetch or a fetcher of yours. TanStack Query and SWR integrations ship as entry points, and fetchQubeePage runs on the server.

3.8 kB over the core

9.3 kB minified for the whole adapter, measured with esbuild when this site was built. Zero runtime dependencies, and the core's drivers still tree-shake.

Wrap once, then a hook

Wrap the app in the adapter of your router. Every list below it calls useQubeeList without naming a router, and useQubeeQuery fetches the page it asks for.

packagemin / gzip
@qubeejs/react9.3 kB / 3.8 kB
with @qubeejs/core (1 driver)28.6 kB / 9.3 kB

Measured with esbuild when this site was built: minified ES2022, React external.

src/main.tsxsrc/app.tsxsrc/routes/root.tsxapp/layout.tsx
import { BrowserAdapter } from '@qubeejs/react';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';

import { App } from './app';

const root = document.getElementById('root');

if (!root) {
  throw new Error('index.html has no #root element');
}

// Every list below the provider reads and writes the URL through browser history.
createRoot(root).render(
  <StrictMode>
    <BrowserAdapter>
      <App />
    </BrowserAdapter>
  </StrictMode>
);
import { ReactRouterAdapter } from '@qubeejs/react/react-router';
import { createBrowserRouter, Outlet, RouterProvider } from 'react-router';

import { ArticlesPage } from './react-router-articles';

/** The root route: every list under it reads and writes the URL through React Router. */
function Root() {
  return (
    <ReactRouterAdapter>
      <Outlet />
    </ReactRouterAdapter>
  );
}

const router = createBrowserRouter([
  {
    children: [{ element: <ArticlesPage />, path: 'articles' }],
    element: <Root />,
    path: '/',
  },
]);

export function App() {
  return <RouterProvider router={router} />;
}
import { TanStackRouterAdapter } from '@qubeejs/react/tanstack-router';
import { createRootRoute, Outlet } from '@tanstack/react-router';

/** The root route: every list under it reads and writes the URL through TanStack Router. */
export const rootRoute = createRootRoute({
  component: () => (
    <TanStackRouterAdapter>
      <Outlet />
    </TanStackRouterAdapter>
  ),
});

Everything else lives in the core docs

The adapter documents nothing the core already documents. Query semantics are the same in every framework binding — read them once, over there.

Rule of thumbIf a symbol is imported from @qubeejs/core, its reference page is in the core docs — not here.