useStoreRegistry
useStoreRegistry(
override?):StoreRegistry
Defined in: react/src/StoreRegistryContext.tsx:61
Hook to access the StoreRegistry from context. Useful for advanced operations like preloading.
Parameters
Section titled “Parameters”override?
Section titled “override?”Optional registry to use instead of the context value. When provided, skips context lookup entirely.
Returns
Section titled “Returns”The registry provided by the nearest StoreRegistryProvider ancestor, or the override if provided.
Throws
Section titled “Throws”Error if called outside a StoreRegistryProvider and no override is provided
Example
Section titled “Example”function PreloadButton({ issueId }: { issueId: string }) { const storeRegistry = useStoreRegistry()
const handleMouseEnter = () => { storeRegistry.preload(issueStoreOptions(issueId)) }
return <button onMouseEnter={handleMouseEnter}>View Issue</button>}