Skip to content

Commit

Permalink
[system] Use the CustomSystemProps interface in Box Props
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnusG committed Dec 23, 2022
1 parent 94bc99f commit 499576b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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 @@ -168,7 +168,7 @@ export type SystemProps<Theme extends object = {}> = {
[K in StandardSystemKeys]?:
| ResponsiveStyleValue<AllSystemCSSProperties[K]>
| ((theme: Theme) => ResponsiveStyleValue<AllSystemCSSProperties[K]>);
};
} & CustomSystemProps;

export interface BoxTypeMap<P = {}, D extends React.ElementType = 'div'> {
props: P &
Expand Down
10 changes: 10 additions & 0 deletions packages/mui-system/src/Box/Box.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ function Test(props: TestProps) {
return <span {...other}>{test}</span>;
}

declare module './Box' {
interface CustomSystemProps {
customProp?: 'customValue';
}
}

function CustomSystemPropsTest() {
<Box customProp="customValue" />;
}

function ResponsiveTest() {
<Box sx={{ p: [2, 3, 4] }} />;
<Box sx={{ p: { xs: 2, sm: 3, md: 4 } }} />;
Expand Down

0 comments on commit 499576b

Please sign in to comment.