Skip to content
API/<QubeeProvider>

<QubeeProvider>

component
src/components/qubee-provider.tsx1 parameter

Share one qubee instance with every component below it — the filters, the table and the pager of one list, as provideNgQubeeInstance() does in Angular.

Pass a configuration (driver, and optionally baseUrl, pagination, request, response) and the provider creates the instance once, on its first render; later changes to the configuration are ignored. Or pass value to share an instance created elsewhere.

The context carries the instance, never its state, so the provider does not re-render its subtree when the query changes: only components that call useQubeeContext do. The nearest provider wins, so nesting scopes a subtree.

import { QubeeProvider } from '@qubeejs/react';
function QubeeProvider(props: QubeeProviderProps): ReactElement
Parameter Type Description
props QubeeProviderProps A configuration or a value, plus the subtree

The subtree, with the instance in context

<QubeeProvider baseUrl="https://example.com/api" driver={STRAPI_DRIVER}>
<ArticleFilters />
<ArticleTable />
</QubeeProvider>

QubeeProviderProps