Skip to content

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.

StoreRegistryProviderProps

Element

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>
)
}