StoreRegistryProvider
StoreRegistryProvider(
__namedParameters):Element
Defined in: react/src/StoreRegistryContext.tsx:36
React context provider that makes a StoreRegistry available to descendant components.
Wrap your application (or a subtree) with this provider to enable useStore and useStoreRegistry hooks within that tree.
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”Returns
Section titled “Returns”Element
Example
Section titled “Example”import { StoreRegistry } from '@livestore/livestore'import { StoreRegistryProvider } from '@livestore/react'import { unstable_batchedUpdates as batchUpdates } from 'react-dom'
const storeRegistry = new StoreRegistry({ defaultOptions: { batchUpdates }})
function App() { return ( <StoreRegistryProvider storeRegistry={storeRegistry}> <MyComponent /> </StoreRegistryProvider> )}