Skip to content

Commit 8e805d7

Browse files
GasimGasimzadabvaughn
authored andcommitted
Add missing avatarSize in "Before you use context" to text and code (#1737)
1 parent de0dfde commit 8e805d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ For example, consider a `Page` component that passes a `user` and `avatarSize` p
5454

5555
It might feel redundant to pass down the `user` and `avatarSize` props through many levels if in the end only the `Avatar` component really needs it. It's also annoying that whenever the `Avatar` component needs more props from the top, you have to add them at all the intermediate levels too.
5656

57-
One way to solve this issue **without context** is to [pass down the `Avatar` component itself](/docs/composition-vs-inheritance.html#containment) so that the intermediate components don't need to know about the `user` prop:
57+
One way to solve this issue **without context** is to [pass down the `Avatar` component itself](/docs/composition-vs-inheritance.html#containment) so that the intermediate components don't need to know about the `user` or `avatarSize` props:
5858

5959
```js
6060
function Page(props) {
@@ -68,7 +68,7 @@ function Page(props) {
6868
}
6969

7070
// Now, we have:
71-
<Page user={user} />
71+
<Page user={user} avatarSize={avatarSize} />
7272
// ... which renders ...
7373
<PageLayout userLink={...} />
7474
// ... which renders ...

0 commit comments

Comments
 (0)