You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/context.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ For example, consider a `Page` component that passes a `user` and `avatarSize` p
54
54
55
55
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.
56
56
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:
Copy file name to clipboardExpand all lines: content/docs/legacy-context.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -152,11 +152,11 @@ If `contextTypes` is defined within a component, the following [lifecycle method
152
152
>
153
153
> As of React 16, `componentDidUpdate` no longer receives `prevContext`.
154
154
155
-
### Referencing Context in Stateless Function Components {#referencing-context-in-stateless-function-components}
155
+
### Referencing Context in Function Components {#referencing-context-in-stateless-function-components}
156
156
157
157
> This section documents a legacy API. See the [new API](/docs/context.html).
158
158
159
-
Stateless function components are also able to reference `context` if `contextTypes` is defined as a property of the function. The following code shows a `Button` component written as a stateless function component.
159
+
Function components are also able to reference `context` if `contextTypes` is defined as a property of the function. The following code shows a `Button` component written as a function component.
0 commit comments