Skip to content

Commit

Permalink
docs: add missing word in client components (#54830)
Browse files Browse the repository at this point in the history
Missing word in client component page in docs when discussing the effect of "use client" on a client component's children and imported components. Not sure if 'children' is the appropriate word or whether there should be a reference to imported components too.
  • Loading branch information
Sylith1231 committed Sep 2, 2023
1 parent a0beb34 commit 96e13c3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default function Counter() {
}
```

The diagram below shows nested components, using `onClick` and `useState` in `toggle.js` will cause an error if the `"use client"` directive is not defined. This is because, by default, the components are rendered on the server where these APIs are not available. By defining the `"use client"` directive to `toggle.js`, you can tell React to render the component and its on the client, where the APIs are available.
The diagram below shows nested components, using `onClick` and `useState` in `toggle.js` will cause an error if the `"use client"` directive is not defined. This is because, by default, the components are rendered on the server where these APIs are not available. By defining the `"use client"` directive to `toggle.js`, you can tell React to render the component and its children on the client, where the APIs are available.

<Image
alt="Use Client Directive and Network Boundary"
Expand Down

0 comments on commit 96e13c3

Please sign in to comment.