From ec3c4e5fd48bd212c21ad9ab2a6de194605c2082 Mon Sep 17 00:00:00 2001 From: Lachlan Campbell Date: Tue, 28 Nov 2023 16:59:17 +0100 Subject: [PATCH] Remove deprecated ThemeProvider export --- packages/theme-provider/src/index.tsx | 27 --------------------------- packages/theme-ui/test/index.tsx | 12 ------------ 2 files changed, 39 deletions(-) diff --git a/packages/theme-provider/src/index.tsx b/packages/theme-provider/src/index.tsx index ae8bb21c4..cee5b93b0 100644 --- a/packages/theme-provider/src/index.tsx +++ b/packages/theme-provider/src/index.tsx @@ -56,30 +56,3 @@ export const ThemeUIProvider = ({ theme, children }: ThemeProviderProps) => { ) } - -/** @deprecated ThemeProvider is now called ThemeUIProvider to reduce confusion with Emotion */ -export const ThemeProvider: React.FC = ({ - theme, - children, -}) => { - React.useEffect(() => { - if (process.env.NODE_ENV !== 'production') { - console.warn( - '[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.' - ) - } - }, []) - - const outer = useThemeUI() - - const isTopLevel = outer === __themeUiDefaultContextValue - - return ( - - - {isTopLevel && } - {children} - - - ) -} diff --git a/packages/theme-ui/test/index.tsx b/packages/theme-ui/test/index.tsx index 337277fa3..75cdc5e41 100644 --- a/packages/theme-ui/test/index.tsx +++ b/packages/theme-ui/test/index.tsx @@ -8,7 +8,6 @@ import mockConsole from 'jest-mock-console' import { fireEvent, render, renderJSON } from '@theme-ui/test-utils' import { - ThemeProvider as DeprecatedThemeProvider, ThemeUIProvider, jsx, BaseStyles, @@ -51,17 +50,6 @@ test('warns when multiple versions of emotion are installed', () => { restore() }) -test('warns deprecated ThemeUIProvider', () => { - const restore = mockConsole() - render( - -
- - ) - expect(console.warn).toHaveBeenCalled() - restore() -}) - test('functional themes receive outer theme', () => { const outer: Theme = { config: {