From 94b7743cbe991a5eeac5873a86f8375a26b06670 Mon Sep 17 00:00:00 2001 From: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> Date: Thu, 24 Aug 2023 17:49:46 +0100 Subject: [PATCH] Docs: Fix formatting issues in the rendering docs (#54517) --- docs/01-getting-started/index.mdx | 4 ++++ .../02-data-fetching/02-patterns.mdx | 1 - .../03-rendering/02-client-components.mdx | 2 +- .../03-rendering/03-composition-patterns.mdx | 8 ++++---- 4 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 docs/01-getting-started/index.mdx diff --git a/docs/01-getting-started/index.mdx b/docs/01-getting-started/index.mdx new file mode 100644 index 0000000000..df84fb94cf --- /dev/null +++ b/docs/01-getting-started/index.mdx @@ -0,0 +1,4 @@ +--- +title: Getting Started +description: Learn how to create full-stack web applications with Next.js. +--- diff --git a/docs/02-app/01-building-your-application/02-data-fetching/02-patterns.mdx b/docs/02-app/01-building-your-application/02-data-fetching/02-patterns.mdx index 854c0eae6c..7425aa1986 100644 --- a/docs/02-app/01-building-your-application/02-data-fetching/02-patterns.mdx +++ b/docs/02-app/01-building-your-application/02-data-fetching/02-patterns.mdx @@ -1,6 +1,5 @@ --- title: Data Fetching Patterns -nav_title: Patterns description: Learn about common data fetching patterns in React and Next.js. --- diff --git a/docs/02-app/01-building-your-application/03-rendering/02-client-components.mdx b/docs/02-app/01-building-your-application/03-rendering/02-client-components.mdx index c4c61bdd8d..eab9879e92 100644 --- a/docs/02-app/01-building-your-application/03-rendering/02-client-components.mdx +++ b/docs/02-app/01-building-your-application/03-rendering/02-client-components.mdx @@ -90,7 +90,7 @@ Then, on the client: 3. The JavaScript instructions are used to [hydrate](https://react.dev/reference/react-dom/client/hydrateRoot) Client Components and make their UI interactive. > **What is hydration?** - +> > Hydration is process of attaching event listeners to the DOM, to make the static HTML interactive. Behind the scenes, hydration is done with the [`hydrateRoot`](https://react.dev/reference/react-dom/client/hydrateRoot) React API. ### Subsequent Navigations diff --git a/docs/02-app/01-building-your-application/03-rendering/03-composition-patterns.mdx b/docs/02-app/01-building-your-application/03-rendering/03-composition-patterns.mdx index 766d9f74a4..88d21febf0 100644 --- a/docs/02-app/01-building-your-application/03-rendering/03-composition-patterns.mdx +++ b/docs/02-app/01-building-your-application/03-rendering/03-composition-patterns.mdx @@ -1,6 +1,6 @@ --- title: Server and Client Composition Patterns -nav_title: Patterns +nav_title: Composition Patterns description: Recommended patterns for using Server and Client Components. --- @@ -346,9 +346,9 @@ You can optimize your package by using ['use client' deeper in the tree](#moving It's worth noting some bundlers might strip out `"use client"` directives. You can find an example of how to configure esbuild to include the `"use client"` directive in the [React Wrap Balancer](https://github.com/shuding/react-wrap-balancer/blob/main/tsup.config.ts#L10-L13) and [Vercel Analytics](https://github.com/vercel/analytics/blob/main/packages/web/tsup.config.js#L26-L30) repositories. -### Client Components +## Client Components -#### Moving Client Components Down the Tree +### Moving Client Components Down the Tree To reduce the Client JavaScript bundle size, we recommend moving Client Components down your component tree. @@ -463,7 +463,7 @@ export default function ClientComponent({ children }) { } ``` -#### Supported Pattern: Passing Server Components to Client Components as Props +### Supported Pattern: Passing Server Components to Client Components as Props The following pattern is supported. You can pass Server Components as a prop to a Client Component.