From fbc4eb54575d793b452debec8141b17fd01576f6 Mon Sep 17 00:00:00 2001 From: Hariom Balhara Date: Wed, 29 Jun 2022 18:50:46 +0000 Subject: [PATCH] Set theme initially so that the gneerated JS code knows the correct theme already (#3193) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/lib/hooks/useTheme.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/lib/hooks/useTheme.tsx b/apps/web/lib/hooks/useTheme.tsx index 25d6e511c1..c4a01e57f0 100644 --- a/apps/web/lib/hooks/useTheme.tsx +++ b/apps/web/lib/hooks/useTheme.tsx @@ -34,7 +34,7 @@ export default function useTheme(theme?: Maybe) { const embedTheme = useEmbedTheme(); // Embed UI configuration takes more precedence over App Configuration theme = embedTheme || theme; - const [_theme, setTheme] = useState>(null); + const [_theme, setTheme] = useState>(theme); useEffect(() => { // TODO: isReady doesn't seem required now. This is also impacting PSI Score for pages which are using isReady. setIsReady(true);