useWeaverse
The useWeaverse hook returns the active Weaverse runtime. Type the generic with what you read, for example useWeaverse<{ data: WeaverseNextPageData }>() for the Next.js page data. A component that calls it is a Client Component.
Import
Type
Returns
T — The active Weaverse runtime. It defaults to the core Weaverse type.
Common Use Patterns
Accessing Component Instances
The itemInstances registry maps component instance IDs to their item stores:
Accessing Page Data
Type data as WeaverseNextPageData to get the Next.js page data type:
Core Properties
itemInstances
Registry mapping component instance IDs to their item stores.
data
The current page data, WeaverseNextPageData: the page ID, name, root ID, SEO and component items.
elementRegistry
Registry mapping component types to their registered component definitions. It is not a registry of DOM elements or component instance IDs.
When To Use
- When you need to find and interact with components outside the current component tree
- When you need access to page-level runtime data
Last modified on November 11, 2026