From 7ee2a08f579498b1d5c1089270940d420900a141 Mon Sep 17 00:00:00 2001 From: Caroline Roeder <38064741+caroe233@users.noreply.github.com> Date: Sat, 23 Mar 2019 10:46:52 +0100 Subject: [PATCH] [Tab] Enable generic props (#15003) * Changed the Tab component to work with generic props (see #13868) * successfully run yarn prettier with the correct config * successfully ran yarn typescript --- packages/material-ui/src/Tab/Tab.d.ts | 34 +++++++++++++++------------ 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/packages/material-ui/src/Tab/Tab.d.ts b/packages/material-ui/src/Tab/Tab.d.ts index a0df1353aa88dd..51c23cada5b647 100644 --- a/packages/material-ui/src/Tab/Tab.d.ts +++ b/packages/material-ui/src/Tab/Tab.d.ts @@ -1,19 +1,23 @@ import * as React from 'react'; -import { StandardProps } from '..'; -import { ButtonBaseProps } from '../ButtonBase'; +import { ExtendButtonBase } from '../ButtonBase'; +import { SimplifiedPropsOf } from '../OverridableComponent'; -export interface TabProps extends StandardProps { - disabled?: boolean; - fullWidth?: boolean; - icon?: string | React.ReactElement; - value?: any; - label?: React.ReactNode; - onChange?: (event: React.ChangeEvent<{ checked: boolean }>, value: any) => void; - onClick?: React.EventHandler; - selected?: boolean; - style?: React.CSSProperties; - textColor?: string | 'secondary' | 'primary' | 'inherit'; -} +declare const Tab: ExtendButtonBase<{ + props: { + disabled?: boolean; + fullWidth?: boolean; + icon?: string | React.ReactElement; + value?: any; + label?: React.ReactNode; + onChange?: (event: React.ChangeEvent<{ checked: boolean }>, value: any) => void; + onClick?: React.EventHandler; + selected?: boolean; + style?: React.CSSProperties; + textColor?: string | 'secondary' | 'primary' | 'inherit'; + }; + defaultComponent: 'div'; + classKey: TabClassKey; +}>; export type TabClassKey = | 'root' @@ -29,6 +33,6 @@ export type TabClassKey = | 'label' | 'labelWrapped'; -declare const Tab: React.ComponentType; +export type TabProps = SimplifiedPropsOf; export default Tab;