Skip to content

Commit 6cae3ff

Browse files
committed
Fix ThemeContext usage in MyPage and MyApp components
1 parent 7fd0417 commit 6cae3ff

File tree

1 file changed

+4
-4
lines changed
  • src/content/reference/react

1 file changed

+4
-4
lines changed

src/content/reference/react/use.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ To pass context to a `Button`, wrap it or one of its parent components into the
7474
```js [[1, 3, "ThemeContext"], [2, 3, "\\"dark\\""], [1, 5, "ThemeContext"]]
7575
function MyPage() {
7676
return (
77-
<ThemeContext.Provider value="dark">
77+
<ThemeContext value="dark">
7878
<Form />
79-
</ThemeContext.Provider>
79+
</ThemeContext>
8080
);
8181
}
8282

@@ -116,9 +116,9 @@ const ThemeContext = createContext(null);
116116

117117
export default function MyApp() {
118118
return (
119-
<ThemeContext.Provider value="dark">
119+
<ThemeContext value="dark">
120120
<Form />
121-
</ThemeContext.Provider>
121+
</ThemeContext>
122122
)
123123
}
124124

0 commit comments

Comments
 (0)