useCopilotSnapshot()
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Subscribes a React component to a copilot handler’s snapshot.
export declare function useCopilotSnapshot<TBuild extends string = CopilotBuildType>(handler: CopilotHandler<TBuild>): ICopilotSnapshot<TBuild>;
Parameters
Parameter | Type | Description |
|---|---|---|
handler | CopilotHandler<TBuild> | Copilot instance to observe. |
Returns
ICopilotSnapshot<TBuild>
The handler’s current, referentially stable snapshot.
Remarks
This optional React adapter does not own the handler. Unmounting or switching handlers unsubscribes the component without disposing the handler.