Skip to content

Commit

Permalink
fix(xplat): XPlatProvider correctly formats variable names for strict…
Browse files Browse the repository at this point in the history
… dom ThemeProvider (#30792)
  • Loading branch information
behowell authored Mar 16, 2024
1 parent 5139c70 commit 7e66dfa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -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<XPlatProviderProps> = 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 <contexts.ThemeProvider customProperties={customProps} children={children} />;
// customProperties should be in the form of { 'camelCasedVariable': 'value' }
return <contexts.ThemeProvider customProperties={theme} children={children} />;
};

This file was deleted.

0 comments on commit 7e66dfa

Please sign in to comment.