Skip to content

Commit 593cce1

Browse files
committed
enabling generic component props for chip
1 parent b556d60 commit 593cce1

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

packages/material-ui/src/Chip/Chip.d.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import * as React from 'react';
2-
import { StandardProps, PropTypes } from '..';
2+
import { PropTypes } from '..';
3+
import { OverridableComponent, SimplifiedPropsOf } from '../OverridableComponent';
34

4-
export interface ChipProps
5-
extends StandardProps<React.HTMLAttributes<HTMLDivElement>, ChipClassKey> {
6-
avatar?: React.ReactElement;
7-
clickable?: boolean;
8-
color?: PropTypes.Color;
9-
component?: React.ElementType<ChipProps>;
10-
deleteIcon?: React.ReactElement;
11-
icon?: React.ReactElement;
12-
label?: React.ReactNode;
13-
onDelete?: React.EventHandler<any>;
14-
variant?: 'default' | 'outlined';
15-
}
5+
declare const Chip: OverridableComponent<{
6+
props: {
7+
avatar?: React.ReactElement;
8+
clickable?: boolean;
9+
color?: PropTypes.Color;
10+
deleteIcon?: React.ReactElement;
11+
icon?: React.ReactElement;
12+
label?: React.ReactNode;
13+
onDelete?: React.EventHandler<any>;
14+
variant?: 'default' | 'outlined';
15+
};
16+
defaultComponent: 'div';
17+
classKey: ChipClassKey;
18+
}>;
1619

1720
export type ChipClassKey =
1821
| 'root'
@@ -41,6 +44,6 @@ export type ChipClassKey =
4144
| 'deleteIconOutlinedColorPrimary'
4245
| 'deleteIconOutlinedColorSecondary';
4346

44-
declare const Chip: React.ComponentType<ChipProps>;
47+
export type ChipProps = SimplifiedPropsOf<typeof Chip>;
4548

4649
export default Chip;

0 commit comments

Comments
 (0)