Skip to content

Commit a6e05ee

Browse files
authored
[material-ui] Fix wrong slotProps of DetailsHTMLAttributes types (#45356)
1 parent cc6f888 commit a6e05ee

File tree

2 files changed

+7
-35
lines changed

2 files changed

+7
-35
lines changed

packages/mui-material/src/Alert/Alert.d.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,17 @@ export type AlertSlotsAndSlotProps = CreateSlotsAndSlotProps<
6767
* Props forwarded to the icon slot.
6868
* By default, the avaible props are based on a div element.
6969
*/
70-
icon: SlotProps<
71-
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
72-
AlertIconSlotPropsOverrides,
73-
AlertOwnerState
74-
>;
70+
icon: SlotProps<'div', AlertIconSlotPropsOverrides, AlertOwnerState>;
7571
/**
7672
* Props forwarded to the message slot.
7773
* By default, the avaible props are based on a div element.
7874
*/
79-
message: SlotProps<
80-
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
81-
AlertMessageSlotPropsOverrides,
82-
AlertOwnerState
83-
>;
75+
message: SlotProps<'div', AlertMessageSlotPropsOverrides, AlertOwnerState>;
8476
/**
8577
* Props forwarded to the action slot.
8678
* By default, the avaible props are based on a div element.
8779
*/
88-
action: SlotProps<
89-
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
90-
AlertActionSlotPropsOverrides,
91-
AlertOwnerState
92-
>;
80+
action: SlotProps<'div', AlertActionSlotPropsOverrides, AlertOwnerState>;
9381
/**
9482
* Props forwarded to the closeButton slot.
9583
* By default, the avaible props are based on the [IconButton](https://mui.com/material-ui/api/icon-button/#props) component.

packages/mui-material/src/CardHeader/CardHeader.d.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,38 +60,22 @@ export type CardHeaderSlotsAndSlotProps = CreateSlotsAndSlotProps<
6060
* Props forwarded to the root slot.
6161
* By default, the avaible props are based on the div element.
6262
*/
63-
root: SlotProps<
64-
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
65-
CardHeaderRootSlotPropsOverrides,
66-
CardHeaderOwnerState
67-
>;
63+
root: SlotProps<'div', CardHeaderRootSlotPropsOverrides, CardHeaderOwnerState>;
6864
/**
6965
* Props forwarded to the avatar slot.
7066
* By default, the avaible props are based on the div element.
7167
*/
72-
avatar: SlotProps<
73-
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
74-
CardHeaderAvatarSlotPropsOverrides,
75-
CardHeaderOwnerState
76-
>;
68+
avatar: SlotProps<'div', CardHeaderAvatarSlotPropsOverrides, CardHeaderOwnerState>;
7769
/**
7870
* Props forwarded to the action slot.
7971
* By default, the avaible props are based on the div element.
8072
*/
81-
action: SlotProps<
82-
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
83-
CardHeaderActionSlotPropsOverrides,
84-
CardHeaderOwnerState
85-
>;
73+
action: SlotProps<'div', CardHeaderActionSlotPropsOverrides, CardHeaderOwnerState>;
8674
/**
8775
* Props forwarded to the content slot.
8876
* By default, the avaible props are based on the div element.
8977
*/
90-
content: SlotProps<
91-
React.ElementType<React.DetailsHTMLAttributes<HTMLDivElement>>,
92-
CardHeaderContentSlotPropsOverrides,
93-
CardHeaderOwnerState
94-
>;
78+
content: SlotProps<'div', CardHeaderContentSlotPropsOverrides, CardHeaderOwnerState>;
9579
/**
9680
* Props forwarded to the title slot (as long as disableTypography is not `true`).
9781
* By default, the avaible props are based on the [Typography](https://mui.com/material-ui/api/typography/#props) component.

0 commit comments

Comments
 (0)