({
theme,
children,
})
| 59 | |
| 60 | /** @deprecated ThemeProvider is now called ThemeUIProvider to reduce confusion with Emotion */ |
| 61 | export const ThemeProvider: React.FC<ThemeProviderProps> = ({ |
| 62 | theme, |
| 63 | children, |
| 64 | }) => { |
| 65 | React.useEffect(() => { |
| 66 | if (process.env.NODE_ENV !== 'production') { |
| 67 | console.warn( |
| 68 | '[theme-ui] The export ThemeProvider is deprecated and is now called ThemeUIProvider to reduce confusion with Emotion. Please update your import; ThemeProvider will be removed in a future version.' |
| 69 | ) |
| 70 | } |
| 71 | }, []) |
| 72 | |
| 73 | const outer = useThemeUI() |
| 74 | |
| 75 | const isTopLevel = outer === __themeUiDefaultContextValue |
| 76 | |
| 77 | return ( |
| 78 | <CoreProvider theme={theme}> |
| 79 | <ColorModeProvider> |
| 80 | {isTopLevel && <RootStyles />} |
| 81 | {children} |
| 82 | </ColorModeProvider> |
| 83 | </CoreProvider> |
| 84 | ) |
| 85 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…