|
1 | 1 | import * as React from 'react';
|
2 | 2 | import Paper from '@mui/material/Paper';
|
3 |
| -import Grid, { GridProps } from '@mui/material/Grid'; |
4 |
| -import { expectType } from '@mui/types'; |
5 |
| - |
6 |
| -const CustomComponent: React.FC<{ stringProp: string; numberProp: number }> = |
7 |
| - function CustomComponent() { |
8 |
| - return <div />; |
9 |
| - }; |
10 |
| - |
11 |
| -const props: GridProps<'span'> = { |
12 |
| - component: 'span', |
13 |
| - onChange: (event) => { |
14 |
| - expectType<React.FormEvent<HTMLSpanElement>, typeof event>(event); |
15 |
| - }, |
16 |
| -}; |
17 |
| - |
18 |
| -const props2: GridProps = { |
19 |
| - onChange: (event) => { |
20 |
| - expectType<React.FormEvent<HTMLDivElement>, typeof event>(event); |
21 |
| - }, |
22 |
| -}; |
23 |
| - |
24 |
| -const props3: GridProps<'span'> = { |
25 |
| - // @ts-expect-error |
26 |
| - component: 'div', |
27 |
| -}; |
28 |
| - |
29 |
| -const props4: GridProps<typeof CustomComponent> = { |
30 |
| - component: CustomComponent, |
31 |
| - stringProp: '2', |
32 |
| - numberProp: 2, |
33 |
| -}; |
34 |
| - |
35 |
| -const props5: GridProps<typeof CustomComponent> = { |
36 |
| - component: CustomComponent, |
37 |
| - stringProp: '2', |
38 |
| - numberProp: 2, |
39 |
| - // @ts-expect-error |
40 |
| - inCorrectProp: 3, |
41 |
| -}; |
42 |
| - |
43 |
| -// @ts-expect-error |
44 |
| -const props6: GridProps<typeof CustomComponent> = { |
45 |
| - component: CustomComponent, |
46 |
| -}; |
| 3 | +import Grid from '@mui/material/Grid'; |
47 | 4 |
|
48 | 5 | function ResponsiveTest() {
|
49 |
| - return ( |
50 |
| - <React.Fragment> |
51 |
| - <Grid item xs={12} sm={8} md={5} component={Paper} elevation={6} square /> |
52 |
| - <Grid item component={'a'} href="/test" /> |
53 |
| - |
54 |
| - <Grid item component={CustomComponent} stringProp="s" numberProp={1} /> |
55 |
| - { |
56 |
| - // @ts-expect-error |
57 |
| - <Grid item component={CustomComponent} /> |
58 |
| - } |
59 |
| - <Grid |
60 |
| - item |
61 |
| - component="span" |
62 |
| - onChange={(event) => { |
63 |
| - expectType<React.FormEvent<HTMLSpanElement>, typeof event>(event); |
64 |
| - }} |
65 |
| - /> |
66 |
| - </React.Fragment> |
67 |
| - ); |
| 6 | + <Grid item xs={12} sm={8} md={5} component={Paper} elevation={6} square />; |
68 | 7 | }
|
0 commit comments