File tree 1 file changed +20
-1
lines changed
packages/mui-material/src/Typography 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
- import { Typography } from '@mui/material' ;
2
+ import { Typography , TypographyProps } from '@mui/material' ;
3
3
4
4
const typographyTest = ( ) => {
5
5
const CustomComponent : React . FC < { prop1 : string ; prop2 : number } > = function CustomComponent ( ) {
6
6
return < div /> ;
7
7
} ;
8
+
9
+ const CustomComponent2 = ( {
10
+ maxLines,
11
+ ...props
12
+ } : TypographyProps & {
13
+ maxLines ?: number ;
14
+ } ) : JSX . Element => {
15
+ return (
16
+ < Typography
17
+ { ...props }
18
+ sx = { {
19
+ display : maxLines === 0 ? 'block' : '-webkit-box' ,
20
+ } }
21
+ />
22
+ ) ;
23
+ } ;
24
+
8
25
return (
9
26
< div >
10
27
< Typography />
28
+ < CustomComponent2 component = "span" />
29
+ < CustomComponent2 component = "div" />
11
30
< Typography align = "inherit" color = "inherit" display = "block" />
12
31
< Typography align = "left" color = "initial" display = "inline" />
13
32
< Typography align = "right" color = "primary" display = "initial" />
You can’t perform that action at this time.
0 commit comments