Skip to content

Commit

Permalink
[material-ui][Box] Add missing component to BoxProps type (#44643)
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoAndai authored Dec 4, 2024
1 parent e2ba426 commit 617a4e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/mui-material/src/Box/Box.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ declare const Box: OverridableComponent<BoxTypeMap<{}, 'div', MaterialTheme>>;
export type BoxProps<
RootComponent extends React.ElementType = BoxTypeMap['defaultComponent'],
AdditionalProps = {},
> = OverrideProps<BoxTypeMap<AdditionalProps, RootComponent, MaterialTheme>, RootComponent>;
> = OverrideProps<BoxTypeMap<AdditionalProps, RootComponent, MaterialTheme>, RootComponent> & {
component?: React.ElementType;
};

export default Box;
6 changes: 4 additions & 2 deletions packages/mui-material/src/Box/Box.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { Box as SystemBox, createBox } from '@mui/system';
import { Box as SystemBox, BoxProps as SystemBoxProps, createBox } from '@mui/system';
import { expectType } from '@mui/types';
import Box from '@mui/material/Box';
import Box, { BoxProps as MaterialBoxProps } from '@mui/material/Box';
import { createTheme } from '@mui/material/styles';

function ThemeValuesCanBeSpread() {
Expand Down Expand Up @@ -39,3 +39,5 @@ function ColorTest() {
sx={(theme) => ({ backgroundColor: theme.vars.palette.background.default })}
/>;
}

expectType<SystemBoxProps['component'], MaterialBoxProps['component']>;

0 comments on commit 617a4e0

Please sign in to comment.