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
* Add usage example for useContext.
The intent is to show where the hook fits in to the usual Context usage.
* Remove unnecessary comment in code block.
Copy file name to clipboardExpand all lines: content/docs/hooks-reference.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -196,6 +196,50 @@ A component calling `useContext` will always re-render when the context value ch
196
196
>
197
197
>`useContext(MyContext)` only lets you *read* the context and subscribe to its changes. You still need a `<MyContext.Provider>` above in the tree to *provide* the value for this context.
This example is modified for hooks from a previous example in the [Context Advanced Guide](/docs/context.html), where you can find more information about when and how to use Context.
241
+
242
+
199
243
## Additional Hooks {#additional-hooks}
200
244
201
245
The following Hooks are either variants of the basic ones from the previous section, or only needed for specific edge cases. Don't stress about learning them up front.
0 commit comments