Skip to content
API/useQubeeContext()

useQubeeContext()

hook
src/hooks/use-qubee-context.ts0 parameters

Read the nearest QubeeProvider’s instance, and re-render when its query changes.

Each caller subscribes on its own: every component that calls this hook re-renders on every write to the store, while the provider’s other descendants do not.

import { useQubeeContext } from '@qubeejs/react';
function useQubeeContext(): QubeeHandle

The provider’s builder, paginator and store, plus the store’s current state

function ArticleFilters(): ReactElement {
const { builder } = useQubeeContext();
return <button onClick={() => builder.addFilter('status', 'published')}>Published</button>;
}

QubeeHandle