Skip to content

Commit

Permalink
Merge branch 'main' into sync-fcd00068
Browse files Browse the repository at this point in the history
  • Loading branch information
yousufkalim authored Dec 4, 2023
2 parents 5814262 + 97ec4b8 commit 7ac847c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/content/reference/react/use-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ As dependencies of `RichTextEditor`, `formatDate` and `Button` will also be eval
In a React app, components are often split into separate files, or [modules](/learn/importing-and-exporting-components#exporting-and-importing-a-component).

For apps that use React Server Components, the app is server-rendered by default. `'use client'` introduces a server-client boundary in the [module dependency tree](/learn/understanding-your-ui-as-a-tree#the-module-dependency-tree), effectively creating a subtree of Client modules.

To better illustrate this, consider the following React Server Components app.

<Sandpack>
Expand Down Expand Up @@ -307,7 +306,7 @@ export default function Counter({initialValue = 0}) {

</Sandpack>

As `Counter` requires both the `useState` Hook and event handlers to increment or decrement the value, this component must be a Client Component and will require a `'use client'` directive at the top.
As `Counter` requires both the `useState` Hook and event handlers to increment or decrement the value, this component must be a Client Component and will require a `'use client'` directive at the top.4

In contrast, a component that renders UI without interaction will not need to be a Client Component.

Expand Down
3 changes: 2 additions & 1 deletion src/sidebarReference.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
},
{
"title": "useTransition",
"path": "/reference/react/useTransition"
"path": "/reference/react/useTransition",
"canary": true
}
]
},
Expand Down

0 comments on commit 7ac847c

Please sign in to comment.