> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# useCopilotSnapshot()

- Package: [@gooddata/sdk-ui-gen-ai](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-gen-ai/index.md)
- Kind: function
- Stability: alpha
- Source: https://github.com/gooddata/gooddata-ui-sdk/blob/rel/11.68/libs/sdk-ui-gen-ai/src/copilot/useCopilotSnapshot.ts

> **Alpha API.** Initial API, highly likely to change outside SemVer. Don't build on it in production. See [API maturity](https://www.gooddata.ai/docs/gooddata-ui/latest/integrations/platform/api-maturity/index.md).
> 

Subscribes a React component to a copilot handler's snapshot.

**Signature:**

```typescript
export declare function useCopilotSnapshot<TBuild extends string = CopilotBuildType>(handler: CopilotHandler<TBuild>): ICopilotSnapshot<TBuild>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| handler | [CopilotHandler](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-gen-ai/sdk-ui-gen-ai.copilothandler/index.md)&lt;TBuild&gt; | Copilot instance to observe. |

**Returns:**

[ICopilotSnapshot](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-gen-ai/sdk-ui-gen-ai.icopilotsnapshot/index.md)&lt;TBuild&gt;

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.
