
# `useStreamableValue`

<Note type="warning">
  AI SDK RSC is currently experimental. We recommend using [AI SDK
  UI](/docs/ai-sdk-ui/overview) for production. For guidance on migrating from
  RSC to UI, see our [migration guide](/docs/ai-sdk-rsc/migrating-to-ui).
</Note>

It is a React hook that takes a streamable value created using [`createStreamableValue`](/docs/reference/ai-sdk-rsc/create-streamable-value) and returns the current value, error, and pending state.

## Import

<Snippet
  text={`import { useStreamableValue } from "@ai-sdk/rsc"`}
  prompt={false}
/>

## Example

This is useful for consuming streamable values received from a component's props.

```tsx
function MyComponent({ streamableValue }) {
  const [data, error, pending] = useStreamableValue(streamableValue);

  if (pending) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return <div>Data: {data}</div>;
}
```

## API Signature

### Parameters

It accepts a streamable value created using `createStreamableValue`.

### Returns

It is an array, where the first element contains the data, the second element contains an error if it is thrown anytime during the stream, and the third is a boolean indicating if the value is pending.


## Navigation

- [streamUI](/v5/docs/reference/ai-sdk-rsc/stream-ui)
- [createAI](/v5/docs/reference/ai-sdk-rsc/create-ai)
- [createStreamableUI](/v5/docs/reference/ai-sdk-rsc/create-streamable-ui)
- [createStreamableValue](/v5/docs/reference/ai-sdk-rsc/create-streamable-value)
- [readStreamableValue](/v5/docs/reference/ai-sdk-rsc/read-streamable-value)
- [getAIState](/v5/docs/reference/ai-sdk-rsc/get-ai-state)
- [getMutableAIState](/v5/docs/reference/ai-sdk-rsc/get-mutable-ai-state)
- [useAIState](/v5/docs/reference/ai-sdk-rsc/use-ai-state)
- [useActions](/v5/docs/reference/ai-sdk-rsc/use-actions)
- [useUIState](/v5/docs/reference/ai-sdk-rsc/use-ui-state)
- [useStreamableValue](/v5/docs/reference/ai-sdk-rsc/use-streamable-value)
- [render (Removed)](/v5/docs/reference/ai-sdk-rsc/render)


[Full Sitemap](/sitemap.md)
