Skip to content

Commit 149fe26

Browse files
authoredApr 9, 2024··
Deprecate <Tokens /> (#1308)
1 parent a6b2500 commit 149fe26

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed
 

‎.changeset/popular-cherries-invite.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'ai': patch
3+
---
4+
5+
Deprecate <Tokens/>

‎docs/pages/docs/api-reference/tokens.mdx

+8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ layout:
99
The Tokens component is a React Server Component for streaming in tokens in a React Component.
1010
You can view a live demo with Next.js [here](https://rsc-llm-on-the-edge.vercel.app)
1111

12+
<Callout>
13+
<strong>
14+
This API has been deprecated and will be removed in a future release. See
15+
[Generative UI](/docs/concepts/ai-rsc) for the recommended approach to
16+
streaming React UI.
17+
</strong>
18+
</Callout>
19+
1220
## Props
1321

1422
```typescript

‎packages/core/react/tokens.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ type Props = {
88
};
99

1010
/**
11-
* A React Server Component that recursively renders a stream of tokens.
12-
* Can only be used inside of server components.
11+
A React Server Component that recursively renders a stream of tokens.
12+
Can only be used inside of server components.
13+
14+
@deprecated Use RSCs / Generative AI instead.
1315
*/
1416
export async function Tokens(props: Props) {
1517
const { stream } = props;

0 commit comments

Comments
 (0)
Please sign in to comment.