Skip to content

Commit

Permalink
Fix other occurrences of broken links to next.js docs
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Ruflair <[email protected]>
  • Loading branch information
ruflair committed Sep 3, 2023
1 parent 31d75da commit 2e06ce2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ export default function Page() {
}
```

Unfortunately, **this does not work in a Server Component** since function props are [non-serializable](https://nextjs.org/docs/getting-started/react-essentials#passing-props-from-server-to-client-components-serialization).
Instead, the Next.js team recommend moving components like these ["to the leaves"](https://nextjs.org/docs/getting-started/react-essentials#moving-client-components-to-the-leaves) to avoid this issue and improve overall performance.
Unfortunately, **this does not work in a Server Component** since function props are [non-serializable](https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#passing-props-from-server-to-client-components-serialization).
Instead, the Next.js team recommend moving components like these ["down the tree"](https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#moving-client-components-down-the-tree) to avoid this issue and improve overall performance.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Currently, `prepend` does not work reliably with the App Router, but you can wor

## Function props

Props passed from Server Components—for example `page.js` or other routing files—must be [serializable](https://nextjs.org/docs/getting-started/react-essentials#passing-props-from-server-to-client-components-serialization).
Props passed from Server Components—for example `page.js` or other routing files—must be [serializable](https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#passing-props-from-server-to-client-components-serialization).

This works without any additional directives:

Expand Down Expand Up @@ -227,5 +227,5 @@ export default function Page() {
}
```

Instead, the Next.js team recommend moving components like these ["to the leaves"](https://nextjs.org/docs/getting-started/react-essentials#moving-client-components-to-the-leaves) to avoid this issue and improve overall performance.
Instead, the Next.js team recommend moving components like these ["down the tree"](https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#moving-client-components-down-the-tree) to avoid this issue and improve overall performance.
:::
2 changes: 1 addition & 1 deletion examples/base-ui-nextjs-tailwind-ts/src/app/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const SelectButton = React.forwardRef(function SelectButton<

// the components exported from this file have function props which are non-serializable
// therefore they are additionally wrapped with 'use client' here
// https://nextjs.org/docs/getting-started/react-essentials#passing-props-from-server-to-client-components-serialization
// https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#passing-props-from-server-to-client-components-serialization

export function SelectOption(props: OptionProps<string>) {
const {
Expand Down

0 comments on commit 2e06ce2

Please sign in to comment.