API/<QubeeProvider>
<QubeeProvider>
componentsrc/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
Section titled “Import”import { QubeeProvider } from '@qubeejs/react';Signature
Section titled “Signature”function QubeeProvider(props: QubeeProviderProps): ReactElementParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props |
QubeeProviderProps |
A configuration or a value, plus the subtree |
Returns
Section titled “Returns”The subtree, with the instance in context
Example
Section titled “Example”<QubeeProvider baseUrl="https://example.com/api" driver={STRAPI_DRIVER}> <ArticleFilters /> <ArticleTable /></QubeeProvider>