Skip to content

Commit ec3c4e5

Browse files
committed
Remove deprecated ThemeProvider export
1 parent 650c52b commit ec3c4e5

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

packages/theme-provider/src/index.tsx

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -56,30 +56,3 @@ export const ThemeUIProvider = ({ theme, children }: ThemeProviderProps) => {
5656
</CoreProvider>
5757
)
5858
}
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-
}

packages/theme-ui/test/index.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import mockConsole from 'jest-mock-console'
88
import { fireEvent, render, renderJSON } from '@theme-ui/test-utils'
99

1010
import {
11-
ThemeProvider as DeprecatedThemeProvider,
1211
ThemeUIProvider,
1312
jsx,
1413
BaseStyles,
@@ -51,17 +50,6 @@ test('warns when multiple versions of emotion are installed', () => {
5150
restore()
5251
})
5352

54-
test('warns deprecated ThemeUIProvider', () => {
55-
const restore = mockConsole()
56-
render(
57-
<DeprecatedThemeProvider theme={{}}>
58-
<div />
59-
</DeprecatedThemeProvider>
60-
)
61-
expect(console.warn).toHaveBeenCalled()
62-
restore()
63-
})
64-
6553
test('functional themes receive outer theme', () => {
6654
const outer: Theme = {
6755
config: {

0 commit comments

Comments
 (0)