diff --git a/packages/material-ui/src/DialogContentText/DialogContentText.d.ts b/packages/material-ui/src/DialogContentText/DialogContentText.d.ts index 174923182f7c01..db3026ae7e7028 100644 --- a/packages/material-ui/src/DialogContentText/DialogContentText.d.ts +++ b/packages/material-ui/src/DialogContentText/DialogContentText.d.ts @@ -1,12 +1,24 @@ import * as React from 'react'; import { StandardProps } from '..'; -import { TypographyProps } from '../Typography'; +import { TypographyTypeMap } from '../Typography'; +import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent'; -export interface DialogContentTextProps - extends StandardProps {} +export interface DialogContentTextTypeMap< + P = {}, + D extends React.ElementType = TypographyTypeMap['defaultComponent'] +> { + props: P & TypographyTypeMap['props']; + defaultComponent: D; + classKey: DialogContentTextClassKey; +} export type DialogContentTextClassKey = 'root'; -declare const DialogContentText: React.ComponentType; +declare const DialogContentText: OverridableComponent; + +export type DialogContentTextProps< + D extends React.ElementType = DialogContentTextTypeMap['defaultComponent'], + P = {} +> = OverrideProps, D>; export default DialogContentText; diff --git a/packages/material-ui/src/DialogContentText/DialogContentText.spec.tsx b/packages/material-ui/src/DialogContentText/DialogContentText.spec.tsx new file mode 100644 index 00000000000000..f4086ec3279380 --- /dev/null +++ b/packages/material-ui/src/DialogContentText/DialogContentText.spec.tsx @@ -0,0 +1,42 @@ +import React, { FC } from 'react'; +import { DialogContentText } from '@material-ui/core'; + +const DialogContentTextTest = () => { + const CustomComponent: React.FC<{ prop1: string; prop2: number }> = () =>
; + return ( +
+ + + // $ExpectError + + + + + + + + + // $ExpectError + + + + // $ExpectError + + // $ExpectError + + // $ExpectError + + // $ExpectError + + // $ExpectError + + + // $ExpectError + + // $ExpectError + + // $ExpectError + +
+ ); +};