From 9a5bf3e1f1c151720b3ce383fdd9743d4038b71e Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 3 Jun 2022 15:27:06 +0100 Subject: [PATCH] Fix typo --- beta/src/pages/apis/usecontext.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beta/src/pages/apis/usecontext.md b/beta/src/pages/apis/usecontext.md index ed31a2eb..d03ebe12 100644 --- a/beta/src/pages/apis/usecontext.md +++ b/beta/src/pages/apis/usecontext.md @@ -1329,7 +1329,7 @@ Call `useContext` at the top level of your component to read and subscribe to [c import { useContext } from 'react'; function MyComponent() { - const theme = useTheme(ThemeContext); + const theme = useContext(ThemeContext); // ... ``` @@ -1392,4 +1392,4 @@ In both of these cases you should see a warning from React in the console. To fi ``` -Note that the [default value from your `createContext(defaultValue)` call](#specifying-a-fallback-default-value) is only used **if there is no matching provider above at all.** If there is a `` component somewhere in the parent tree, the component calling `useContext(SomeContext)` *will* receive `undefined` as the context value. \ No newline at end of file +Note that the [default value from your `createContext(defaultValue)` call](#specifying-a-fallback-default-value) is only used **if there is no matching provider above at all.** If there is a `` component somewhere in the parent tree, the component calling `useContext(SomeContext)` *will* receive `undefined` as the context value.