diff --git a/packages/react-components/react-platform-adapter/src/XPlatProvider/XPlatProvider.native.tsx b/packages/react-components/react-platform-adapter/src/XPlatProvider/XPlatProvider.native.tsx index efa2ab4a0d89d..83c91c32e7bf2 100644 --- a/packages/react-components/react-platform-adapter/src/XPlatProvider/XPlatProvider.native.tsx +++ b/packages/react-components/react-platform-adapter/src/XPlatProvider/XPlatProvider.native.tsx @@ -1,15 +1,13 @@ import * as React from 'react'; import { contexts } from 'react-strict-dom'; import { type XPlatProviderProps } from './XPlatProvider.types'; -import { createCustomVariablesFromTheme } from './createCustomVariablesFromTheme'; // css variables insertion should be suppressed in native export const suppressCssVariableInsertion = true; export const XPlatProvider: React.FunctionComponent = props => { - const { theme, children } = props; - const customProps = React.useMemo(() => createCustomVariablesFromTheme(theme), [theme]); + const { theme = {}, children } = props; - // customProperties should be in the form of { '--camelCasedVariable': 'value' } - return ; + // customProperties should be in the form of { 'camelCasedVariable': 'value' } + return ; }; diff --git a/packages/react-components/react-platform-adapter/src/XPlatProvider/createCustomVariablesFromTheme.ts b/packages/react-components/react-platform-adapter/src/XPlatProvider/createCustomVariablesFromTheme.ts deleted file mode 100644 index 93bc1cdbdd6fc..0000000000000 --- a/packages/react-components/react-platform-adapter/src/XPlatProvider/createCustomVariablesFromTheme.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { PartialTheme } from '@fluentui/react-theme'; - -/** - * Formats the theme tokens into the right form to be inserted into the react-strict-dom ThemeProvider. - */ -export function createCustomVariablesFromTheme(theme: PartialTheme | undefined): { [key: string]: string } { - if (theme) { - return (Object.keys(theme) as (keyof typeof theme)[]).reduce((cssVars, cssVar) => { - return { ...cssVars, [`--${cssVar}`]: theme[cssVar] }; - }, {}); - } - - return {}; -}