Skip to content

Update typedefs to use boolean instead of true/false #23038

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/pages/components/lists/SimpleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const useStyles = makeStyles((theme: Theme) =>
}),
);

function ListItemLink(props: ListItemProps<'a', { button?: true }>) {
function ListItemLink(props: ListItemProps<'a', { button?: boolean }>) {
return <ListItem button component="a" {...props} />;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/ListItem/ListItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ declare const ListItem: OverridableComponent<
* for `ButtonBase` can then be applied to `ListItem`.
* @default false
*/
button?: false;
button?: boolean;
},
'li'
>
Expand All @@ -119,7 +119,7 @@ declare const ListItem: OverridableComponent<
* for `ButtonBase` can then be applied to `ListItem`.
* @default false
*/
button: true;
button: boolean;
},
'div'
>
Expand Down
4 changes: 2 additions & 2 deletions packages/material-ui/src/MenuItem/MenuItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export interface MenuItemTypeMap<P = {}, D extends React.ElementType = 'li'> {
* - inherits [ListItem API](https://material-ui.com/api/list-item/)
*/
declare const MenuItem: OverridableComponent<
MenuItemTypeMap<{ button: false }, MenuItemTypeMap['defaultComponent']>
MenuItemTypeMap<{ button: boolean }, MenuItemTypeMap['defaultComponent']>
> &
ExtendButtonBase<MenuItemTypeMap<{ button?: true }, MenuItemTypeMap['defaultComponent']>>;
ExtendButtonBase<MenuItemTypeMap<{ button?: boolean }, MenuItemTypeMap['defaultComponent']>>;

export type MenuItemProps<
D extends React.ElementType = MenuItemTypeMap['defaultComponent'],
Expand Down