Skip to content

useStoreRegistry

useStoreRegistry(override?): StoreRegistry

Defined in: react/src/StoreRegistryContext.tsx:61

Hook to access the StoreRegistry from context. Useful for advanced operations like preloading.

StoreRegistry

Optional registry to use instead of the context value. When provided, skips context lookup entirely.

StoreRegistry

The registry provided by the nearest StoreRegistryProvider ancestor, or the override if provided.

Error if called outside a StoreRegistryProvider and no override is provided

function PreloadButton({ issueId }: { issueId: string }) {
const storeRegistry = useStoreRegistry()
const handleMouseEnter = () => {
storeRegistry.preload(issueStoreOptions(issueId))
}
return <button onMouseEnter={handleMouseEnter}>View Issue</button>
}