Skip to content

Commit bf02ac3

Browse files
devplaijjk
andauthored
docs(fetching-data-and-streaming): add missing types to example (vercel#74081)
This PR updates the `use` hook example in the Fetching Data and Streaming section by adding missing TypeScript types for the `posts` prop. Co-authored-by: JJ Kasper <jj@jjsweb.site>
1 parent edc6e18 commit bf02ac3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/01-app/01-getting-started/06-data-fetching-and-streaming.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ Then, in your Client Component, use the `use` hook read the promise:
136136
'use client'
137137
import { use } from 'react'
138138

139-
export default function Posts({ posts }) {
139+
export default function Posts({
140+
posts,
141+
}: {
142+
posts: Promise<{ id: string; title: string }[]>
143+
}) {
140144
const posts = use(posts)
141145

142146
return (

0 commit comments

Comments
 (0)