Skip to content

Commit

Permalink
[material-ui][Box] Fix system properties has incorrect Theme interf…
Browse files Browse the repository at this point in the history
…ace when applied directly (#39404)
  • Loading branch information
Semigradsky committed Oct 12, 2023
1 parent 544b10a commit 14dd169
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/mui-material/src/Box/Box.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ expectType<typeof Box, typeof CustomBox>(CustomBox);

// @ts-expect-error System's Box has different type than Material UI's Box
expectType<typeof SystemBox, typeof CustomBox>(CustomBox);

function ColorTest() {
<Box
color={(theme) => theme.vars.palette.common.black}
sx={(theme) => ({ backgroundColor: theme.vars.palette.background.default })}
/>;
}
2 changes: 1 addition & 1 deletion packages/mui-system/src/Box/Box.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export type SystemProps<Theme extends object = {}> = {
| ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>);
};

export interface BoxOwnProps<Theme extends object = SystemTheme> extends SystemProps<SystemTheme> {
export interface BoxOwnProps<Theme extends object = SystemTheme> extends SystemProps<Theme> {
children?: React.ReactNode;
/**
* The component used for the root node.
Expand Down

0 comments on commit 14dd169

Please sign in to comment.