API/useQubeeContext()
useQubeeContext()
hooksrc/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
Section titled “Import”import { useQubeeContext } from '@qubeejs/react';Signature
Section titled “Signature”function useQubeeContext(): QubeeHandleReturns
Section titled “Returns”The provider’s builder, paginator and store, plus the store’s current state
Example
Section titled “Example”function ArticleFilters(): ReactElement { const { builder } = useQubeeContext();
return <button onClick={() => builder.addFilter('status', 'published')}>Published</button>;}