-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[material-ui][TableSortLabel] Add slots and slotProps #44728
Conversation
Netlify deploy previewhttps://deploy-preview-44728--material-ui.netlify.app/ TableSortLabel: parsed: +2.13% , gzip: +1.89% Bundle size reportDetails of bundle changes (Toolpad) |
Based on the decision, we are move forward as planned before by supporting callback in the slotProps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The slots
and slotProps
are missing the root
slot
@siriwatknp Added |
*/ | ||
icon: SlotProps< | ||
React.ElementType<React.SVGAttributes<SVGSVGElement>>, | ||
{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{}, | |
TableSortLabelIconSlotPropsOverrides, |
*/ | ||
root: SlotProps< | ||
React.ElementType<React.HTMLAttributes<HTMLSpanElement>>, | ||
{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{}, | |
TableSortLabelRootSlotPropsOverrides, |
/** | ||
* Props forwarded to the icon slot. | ||
*/ | ||
icon: SlotProps< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can you move the root
first (before icon). I find it easier to scan.
} | ||
>; | ||
|
||
export interface TableSortLabelOwnerState extends TableSortLabelProps {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export interface TableSortLabelOwnerState extends TableSortLabelProps {} | |
export interface TableSortLabelOwnerState extends TableSortLabelOwnProps {} |
To prevent recursion types.
|
||
export interface TableSortLabelOwnerState extends TableSortLabelProps {} | ||
|
||
export interface TableSortLabelOwnProps extends TableSortLabelSlotsAndSlotProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved TableSortLabelSlotsAndSlotProps
to TableSortLabelTypeMap
instead
export interface TableSortLabelOwnProps extends TableSortLabelSlotsAndSlotProps { | |
export interface TableSortLabelOwnProps { |
export type TableSortLabelTypeMap<
AdditionalProps = {},
RootComponent extends React.ElementType = 'span',
> = ExtendButtonBaseTypeMap<{
- props: AdditionalProps & TableSortLabelOwnProps;
+ props: AdditionalProps & TableSortLabelOwnProps & TableSortLabelSlotsAndSlotProps;
defaultComponent: RootComponent;
}>;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice.
Part of #41281
This PR just adds
slots
andslotProps
and doesn't deprecateIconComponent
yet. Check this comment for why #42157 (comment)