Skip to content

Commit

Permalink
docs(ssr): Updated note about TS error with async server components
Browse files Browse the repository at this point in the history
This issue has been fixed now in vercel/next.js#50557
  • Loading branch information
custardcream98 committed Jul 3, 2023
1 parent 3e2679f commit 4381ebd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/react/guides/ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ Fetch your data in a Server Component higher up in the component tree than the C
- Wrap the component tree that needs the prefetched queries inside `<Hydrate>`, and provide it with the dehydrated state
- You can fetch inside multiple Server Components and use `<Hydrate>` in multiple places

> NOTE: TypeScript currently complains of a type error when using async Server Components. As a temporary workaround, use `{/* @ts-expect-error Server Component */}` when calling this component inside another. For more information, see [End-to-End Type Safety](https://beta.nextjs.org/docs/configuring/typescript#end-to-end-type-safety) in the Next.js 13 beta docs.
> NOTE: If you encounter a type error while using async Server Components with TypeScript versions lower than `5.1.3` and `@types/react` versions lower than `18.2.8`, it is recommended to update to the latest versions of both. Alternatively, you can use the temporary workaround of adding `{/* @ts-expect-error Server Component */}` when calling this component inside another. For more information, see [Async Server Component TypeScript Error](https://nextjs.org/docs/app/building-your-application/configuring/typescript#async-server-component-typescript-error) in the Next.js 13 docs.
```tsx
// app/hydratedPosts.jsx
Expand Down

0 comments on commit 4381ebd

Please sign in to comment.