From 66d50be35a35c83936b26d4ccdc417ee86b13abd Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Sat, 5 Aug 2023 11:27:56 +0500 Subject: [PATCH] theme: improve check for inheriting emotion theme --- packages/theme/src/emotion/theme-provider.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/theme/src/emotion/theme-provider.tsx b/packages/theme/src/emotion/theme-provider.tsx index 9a1f3b2e2..7de3b35c7 100644 --- a/packages/theme/src/emotion/theme-provider.tsx +++ b/packages/theme/src/emotion/theme-provider.tsx @@ -23,7 +23,8 @@ import { useThemeColors, useThemeEngineStore, ScopedThemeProvider as NNScopedThemeProvider, - ThemeFactory + ThemeFactory, + Theme } from "../"; import React, { ForwardedRef, PropsWithChildren, useMemo } from "react"; import { Box, BoxProps } from "@theme-ui/components"; @@ -45,7 +46,7 @@ function _EmotionThemeProvider( className, ...restProps } = props; - const emotionTheme = useTheme(); + const emotionTheme = useTheme() as Theme; const theme = useThemeEngineStore((store) => store.theme); const themeScope = useThemeColors(scope); const { colors } = themeScope; @@ -62,7 +63,9 @@ function _EmotionThemeProvider( return (