Skip to content

useStoreRegistry

useStoreRegistry(override?): any

Defined in: StoreRegistryContext.tsx:62

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

any

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

any

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