Skip to content

Commit 9afcbf6

Browse files
[React19-blog]: Make use(context) example easier to understand (#6783)
* Make use(Context) example easier to understand * Update src/content/blog/2024/04/25/react-19.md Co-authored-by: Ricky <[email protected]> * Update src/content/blog/2024/04/25/react-19.md Co-authored-by: Ricky <[email protected]> * Update src/content/blog/2024/04/25/react-19.md Co-authored-by: Ricky <[email protected]> * Update src/content/blog/2024/04/25/react-19.md Co-authored-by: Ricky <[email protected]> --------- Co-authored-by: Ricky <[email protected]>
1 parent 317dcf3 commit 9afcbf6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/content/blog/2024/04/25/react-19.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,14 @@ import LightThemeContext from './LightThemeContext'
280280
import DarkThemeContext from './ThemeContext'
281281

282282
function ThemedPage({theme, children}) {
283-
let theme;
283+
let currentTheme;
284284
if (theme === 'dark') {
285-
theme = use(DarkThemeContext);
285+
currentTheme = use(DarkThemeContext);
286286
} else {
287-
theme = use(LightThemeContext);
287+
currentTheme = use(LightThemeContext);
288288
}
289289
return (
290-
<Page theme={theme}>
290+
<Page theme={currentTheme}>
291291
{children}
292292
</Page>
293293
);

0 commit comments

Comments
 (0)