From 617a4e075d0e26ec44df0ac5fedfae89d1541240 Mon Sep 17 00:00:00 2001 From: Diego Andai Date: Wed, 4 Dec 2024 10:19:46 -0300 Subject: [PATCH] [material-ui][Box] Add missing `component` to `BoxProps` type (#44643) --- packages/mui-material/src/Box/Box.d.ts | 4 +++- packages/mui-material/src/Box/Box.spec.tsx | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/mui-material/src/Box/Box.d.ts b/packages/mui-material/src/Box/Box.d.ts index 1a9c2df9a80fbf..55d5f2928abb38 100644 --- a/packages/mui-material/src/Box/Box.d.ts +++ b/packages/mui-material/src/Box/Box.d.ts @@ -18,6 +18,8 @@ declare const Box: OverridableComponent>; export type BoxProps< RootComponent extends React.ElementType = BoxTypeMap['defaultComponent'], AdditionalProps = {}, -> = OverrideProps, RootComponent>; +> = OverrideProps, RootComponent> & { + component?: React.ElementType; +}; export default Box; diff --git a/packages/mui-material/src/Box/Box.spec.tsx b/packages/mui-material/src/Box/Box.spec.tsx index 9fe1b4a539364b..2935a971275357 100644 --- a/packages/mui-material/src/Box/Box.spec.tsx +++ b/packages/mui-material/src/Box/Box.spec.tsx @@ -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() { @@ -39,3 +39,5 @@ function ColorTest() { sx={(theme) => ({ backgroundColor: theme.vars.palette.background.default })} />; } + +expectType;