From a222ae55bda0ef6b568d162f45f0736c3a7100f1 Mon Sep 17 00:00:00 2001 From: Renishgotecha Date: Tue, 18 Mar 2025 13:00:15 +0530 Subject: [PATCH] Resolve #178 | Type error: Type 'string | undefined' is not assignable to type 'string'. --- src/components/core/theme-provider/emotion-cache.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/core/theme-provider/emotion-cache.tsx b/src/components/core/theme-provider/emotion-cache.tsx index 67b6e4ba8..ca0a3b902 100644 --- a/src/components/core/theme-provider/emotion-cache.tsx +++ b/src/components/core/theme-provider/emotion-cache.tsx @@ -54,7 +54,7 @@ export default function NextAppDirEmotionCacheProvider(props: NextAppDirEmotionC let styles = ''; let dataEmotionAttribute = registry.cache.key; - const globals: { name: string; style: string }[] = []; + const globals: { name: string; style: string | undefined }[] = []; inserted.forEach(({ name, isGlobal }) => { const style = registry.cache.inserted[name]; @@ -63,7 +63,7 @@ export default function NextAppDirEmotionCacheProvider(props: NextAppDirEmotionC if (isGlobal) { globals.push({ name, style }); } else { - styles += style; + styles += style || ""; dataEmotionAttribute += ` ${name}`; } } @@ -74,7 +74,7 @@ export default function NextAppDirEmotionCacheProvider(props: NextAppDirEmotionC {globals.map( ({ name, style }): React.JSX.Element => (