Skip to content

Commit e4cb37d

Browse files
committed
fix(root-provider): make id a prop
fix #305
1 parent 09bd401 commit e4cb37d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/lib/RootTheme/RootThemeProvider.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import {useRootTheme} from './useRootTheme';
1010
/**
1111
* @public
1212
*/
13-
export type RootThemeProviderProps = DataAttributes &
14-
Omit<LibraryProps, 'id'> & {children: ReactNode; theme: ThemeType};
13+
export type RootThemeProviderProps = DataAttributes & LibraryProps & {children: ReactNode; theme: ThemeType};
1514

1615
/**
1716
* @public
@@ -20,7 +19,13 @@ export type RootThemeProviderProps = DataAttributes &
2019
* @see ThemeType
2120
* @see https://github.com/morewings/css-vars-hook#type-safety
2221
*/
23-
export const RootThemeProvider: FC<RootThemeProviderProps> = ({children, theme, className, ...nativeProps}) => {
22+
export const RootThemeProvider: FC<RootThemeProviderProps> = ({
23+
children,
24+
theme,
25+
className,
26+
id = ROOT_ID,
27+
...nativeProps
28+
}) => {
2429
const {setTheme, style, getTheme, getVariable, setVariable, removeVariable} = useRootTheme(theme);
2530

2631
const {Provider} = RootContext;
@@ -36,7 +41,7 @@ export const RootThemeProvider: FC<RootThemeProviderProps> = ({children, theme,
3641

3742
return (
3843
<Provider value={actions}>
39-
<div {...nativeProps} id={ROOT_ID} className={className} style={style}>
44+
<div {...nativeProps} id={id} className={className} style={style}>
4045
{children}
4146
</div>
4247
</Provider>

0 commit comments

Comments
 (0)