From 9afcbf6a0c533c8c8df68b5e37d2bfd667942ef8 Mon Sep 17 00:00:00 2001 From: Fran Zekan Date: Thu, 25 Apr 2024 23:12:08 +0200 Subject: [PATCH] [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 * Update src/content/blog/2024/04/25/react-19.md Co-authored-by: Ricky * Update src/content/blog/2024/04/25/react-19.md Co-authored-by: Ricky * Update src/content/blog/2024/04/25/react-19.md Co-authored-by: Ricky --------- Co-authored-by: Ricky --- src/content/blog/2024/04/25/react-19.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/blog/2024/04/25/react-19.md b/src/content/blog/2024/04/25/react-19.md index d5c5b6157..f6b636873 100644 --- a/src/content/blog/2024/04/25/react-19.md +++ b/src/content/blog/2024/04/25/react-19.md @@ -280,14 +280,14 @@ import LightThemeContext from './LightThemeContext' import DarkThemeContext from './ThemeContext' function ThemedPage({theme, children}) { - let theme; + let currentTheme; if (theme === 'dark') { - theme = use(DarkThemeContext); + currentTheme = use(DarkThemeContext); } else { - theme = use(LightThemeContext); + currentTheme = use(LightThemeContext); } return ( - + {children} );