Unverified Commit c02a04d9 authored by Eng Zer Jun's avatar Eng Zer Jun Committed by GitHub

docs: fix highlight in 05-server-and-client-components.mdx (#87347)

In the **When to use Server and Client Components?** section of [Server
and Client
Components](https://nextjs.org/docs/app/getting-started/server-and-client-components)
page, the code block should highlight line 17 `<LikeButton
likes={post.likes} />` to demonstrate that it is passing a prop to the
component.


![](https://github.com/user-attachments/assets/c32ba20b-7a52-4855-807a-ea3930c7032b)

---------
Co-authored-by: 's avatarJoseph <sephxd1234@gmail.com>
Co-authored-by: 's avatarJoseph <joseph.chamochumbi@vercel.com>
parent 92f72373
......@@ -32,7 +32,7 @@ Use **Server Components** when you need:
For example, the `<Page>` component is a Server Component that fetches data about a post, and passes it as props to the `<LikeButton>` which handles client-side interactivity.
```tsx filename="app/[id]/page.tsx" highlight={1,12} switcher
```tsx filename="app/[id]/page.tsx" highlight={1,17} switcher
import LikeButton from '@/app/ui/like-button'
import { getPost } from '@/lib/data'
......@@ -241,7 +241,7 @@ export default function Search() {
You can pass data from Server Components to Client Components using props.
```tsx filename="app/[id]/page.tsx" highlight={1,7} switcher
```tsx filename="app/[id]/page.tsx" highlight={1,12} switcher
import LikeButton from '@/app/ui/like-button'
import { getPost } from '@/lib/data'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment