Skip to content

Commit

Permalink
[List] Change ListItemIcon children type from element to Node (#20577)
Browse files Browse the repository at this point in the history
* [ListItemIcon] Change `children` PropType to node

* conditional children

Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
  • Loading branch information
alielkhateeb and oliviertassinari authored Apr 16, 2020
1 parent b17e685 commit 1a9b939
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/pages/api-docs/list-item-icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The `MuiListItemIcon` name can be used for providing [default props](/customizat

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|
| <span class="prop-name required">children&nbsp;*</span> | <span class="prop-type">element</span> | | The content of the component, normally `Icon`, `SvgIcon`, or a `@material-ui/icons` SVG icon element. |
| <span class="prop-name">children</span> | <span class="prop-type">node</span> | | The content of the component, normally `Icon`, `SvgIcon`, or a `@material-ui/icons` SVG icon element. |
| <span class="prop-name">classes</span> | <span class="prop-type">object</span> | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. |

The `ref` is forwarded to the root element.
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/ListItemIcon/ListItemIcon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface ListItemIconProps
* The content of the component, normally `Icon`, `SvgIcon`,
* or a `@material-ui/icons` SVG icon element.
*/
children: React.ReactElement;
children?: React.ReactNode;
}

export type ListItemIconClassKey = 'root';
Expand Down
2 changes: 1 addition & 1 deletion packages/material-ui/src/ListItemIcon/ListItemIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ListItemIcon.propTypes = {
* The content of the component, normally `Icon`, `SvgIcon`,
* or a `@material-ui/icons` SVG icon element.
*/
children: PropTypes.element.isRequired,
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
Expand Down

0 comments on commit 1a9b939

Please sign in to comment.