Skip to content

Commit 0eb2ba1

Browse files
authored
[material-ui] Revert deprecation warnings for *Components and *Props for v6 (#42466)
1 parent bc31b61 commit 0eb2ba1

35 files changed

+33
-595
lines changed

docs/data/material/migration/migrating-from-deprecated-apis/migrating-from-deprecated-apis.md

Lines changed: 0 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,6 @@ The composed CSS classes are going to be deprecated and eventually removed in fa
4040
For example, the `.MuiAccordionSummary-contentGutters` class was deprecated in favor of the `.MuiAccordionSummary-gutters` and `.MuiAccordionSummary-content` classes.
4141
This improves the developer experience by reducing bloat and cognitive load.
4242

43-
## Accordion
44-
45-
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#accordion-props) below to migrate the code as described in the following sections:
46-
47-
```bash
48-
npx @mui/codemod@latest deprecations/accordion-props <path>
49-
```
50-
51-
### TransitionComponent
52-
53-
The Accordion's `TransitionComponent` prop was deprecated in favor of `slots.transition`:
54-
55-
```diff
56-
<Accordion
57-
- TransitionComponent={CustomTransition}
58-
+ slots={{ transition: CustomTransition }}
59-
/>
60-
```
61-
62-
### TransitionProps
63-
64-
The Accordion's `TransitionProps` prop was deprecated in favor of `slotProps.transition`:
65-
66-
```diff
67-
<Accordion
68-
- TransitionProps={{ unmountOnExit: true }}
69-
+ slotProps={{ transition: { unmountOnExit: true } }}
70-
/>
71-
```
72-
7343
## AccordionSummary
7444

7545
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#accordion-summary-classes) below to migrate the code as described in the following sections:
@@ -235,38 +205,6 @@ Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-code
235205
npx @mui/codemod@next deprecations/autocomplete-props <path>
236206
```
237207

238-
### \*Component props
239-
240-
All of the Autocomplete's slot (`*Component`) props were deprecated in favor of equivalent `slots` entries:
241-
242-
```diff
243-
<Autocomplete
244-
- ListboxComponent={CustomListboxComponent}
245-
- PaperComponent={CustomPaperComponent}
246-
- PopperComponent={CustomPopperComponent}
247-
+ slots={{
248-
+ listbox: CustomListboxComponent,
249-
+ paper: CustomPaperComponent,
250-
+ popper: CustomPopperComponent,
251-
+ }}
252-
/>
253-
```
254-
255-
### \*Props props
256-
257-
All of the Autocomplete's slot props (`*Props`) props were deprecated in favor of equivalent `slotProps` entries:
258-
259-
```diff
260-
<Autocomplete
261-
- ChipProps={CustomChipProps}
262-
- ListboxProps={CustomListboxProps}
263-
+ slotProps={{
264-
+ chip: CustomChipProps,
265-
+ listbox: CustomListboxProps,
266-
+ }}
267-
/>
268-
```
269-
270208
### componentsProps
271209

272210
The Autocomplete's `componentsProps` prop was deprecated in favor of `slotProps`:
@@ -287,32 +225,6 @@ The Autocomplete's `componentsProps` prop was deprecated in favor of `slotProps`
287225
/>
288226
```
289227

290-
## Avatar
291-
292-
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#avatar-props) below to migrate the code as described in the following sections:
293-
294-
```bash
295-
npx @mui/codemod@latest deprecations/avatar-props <path>
296-
```
297-
298-
### imgProps
299-
300-
The Avatar's `imgProps` prop was deprecated in favor of `slotProps.img`:
301-
302-
```diff
303-
<Avatar
304-
- imgProps={{
305-
- onError: () => {},
306-
- onLoad: () => {},
307-
+ slotProps={{
308-
+ img: {
309-
+ onError: () => {},
310-
+ onLoad: () => {},
311-
+ }
312-
}}
313-
/>;
314-
```
315-
316228
## AvatarGroup
317229

318230
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#avatar-group-props) below to migrate the code as described in the following sections:
@@ -401,16 +313,6 @@ The Backdrop's `componentsProps` prop was deprecated in favor of `slotProps`:
401313
/>
402314
```
403315

404-
### TransitionComponent
405-
406-
The Backdrop's `TransitionComponent` prop was deprecated in favor of `slots.transition`:
407-
408-
```diff
409-
<Slider
410-
- TransitionComponent={CustomTransition}
411-
+ slots={{ transition: CustomTransition }}
412-
```
413-
414316
## Badge
415317

416318
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#badge-props) below to migrate the code as described in the following sections:
@@ -1616,28 +1518,6 @@ The StepLabel's `componentsProps` prop was deprecated in favor of `slotProps`:
16161518
/>
16171519
```
16181520

1619-
### StepIconComponent
1620-
1621-
The StepLabel's `StepIconComponent` prop was deprecated in favor of `slots.stepIcon`:
1622-
1623-
```diff
1624-
<StepLabel
1625-
- StepIconComponent={StepIconComponent}
1626-
+ slots={{ stepIcon: StepIconComponent }}
1627-
/>
1628-
```
1629-
1630-
### StepIconProps
1631-
1632-
The StepLabel's `StepIconProps` prop was deprecated in favor of `slotProps.stepIcon`:
1633-
1634-
```diff
1635-
<StepLabel
1636-
- StepIconProps={StepIconProps}
1637-
+ slotProps={{ stepIcon: StepIconProps }}
1638-
/>
1639-
```
1640-
16411521
## StepConnector
16421522

16431523
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#step-connector-classes) below to migrate the code as described in the following sections:
@@ -1677,32 +1557,3 @@ Here's how to migrate:
16771557
},
16781558
},
16791559
```
1680-
1681-
## SpeedDial
1682-
1683-
Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#speed-dial-props) below to migrate the code as described in the following sections:
1684-
1685-
```bash
1686-
npx @mui/codemod@next deprecations/speed-dial-props <path>
1687-
```
1688-
1689-
### TransitionComponent
1690-
1691-
The SpeedDial's `TransitionComponent` prop was deprecated in favor of `slots.transition`:
1692-
1693-
```diff
1694-
<SpeedDial
1695-
- TransitionComponent={CustomTransition}
1696-
+ slots={{ transition: CustomTransition }}
1697-
```
1698-
1699-
### TransitionProps
1700-
1701-
The SpeedDial's `TransitionProps` prop was deprecated in favor of `slotProps.transition`:
1702-
1703-
```diff
1704-
<SpeedDial
1705-
- TransitionProps={{ unmountOnExit: true }}
1706-
+ slotProps={{ transition: { unmountOnExit: true } }}
1707-
/>
1708-
```

docs/pages/material-ui/api/accordion.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,8 @@
2929
},
3030
"additionalInfo": { "sx": true }
3131
},
32-
"TransitionComponent": {
33-
"type": { "name": "elementType" },
34-
"deprecated": true,
35-
"deprecationInfo": "Use <code>slots.transition</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
36-
},
37-
"TransitionProps": {
38-
"type": { "name": "object" },
39-
"deprecated": true,
40-
"deprecationInfo": "Use <code>slotProps.transition</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
41-
}
32+
"TransitionComponent": { "type": { "name": "elementType" } },
33+
"TransitionProps": { "type": { "name": "object" } }
4234
},
4335
"name": "Accordion",
4436
"imports": [

docs/pages/material-ui/api/autocomplete.json

Lines changed: 5 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
},
1717
"default": "false"
1818
},
19-
"ChipProps": {
20-
"type": { "name": "object" },
21-
"deprecated": true,
22-
"deprecationInfo": "Use <code>slotProps.chip</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
23-
},
19+
"ChipProps": { "type": { "name": "object" } },
2420
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
2521
"clearIcon": { "type": { "name": "node" }, "default": "<ClearIcon fontSize=\"small\" />" },
2622
"clearOnBlur": { "type": { "name": "bool" }, "default": "!props.freeSolo" },
@@ -97,17 +93,8 @@
9793
}
9894
},
9995
"limitTags": { "type": { "name": "custom", "description": "integer" }, "default": "-1" },
100-
"ListboxComponent": {
101-
"type": { "name": "elementType" },
102-
"default": "'ul'",
103-
"deprecated": true,
104-
"deprecationInfo": "Use <code>slots.listbox</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
105-
},
106-
"ListboxProps": {
107-
"type": { "name": "object" },
108-
"deprecated": true,
109-
"deprecationInfo": "Use <code>slotProps.listbox</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
110-
},
96+
"ListboxComponent": { "type": { "name": "elementType" }, "default": "'ul'" },
97+
"ListboxProps": { "type": { "name": "object" } },
11198
"loading": { "type": { "name": "bool" }, "default": "false" },
11299
"loadingText": { "type": { "name": "node" }, "default": "'Loading…'" },
113100
"multiple": { "type": { "name": "bool" }, "default": "false" },
@@ -150,18 +137,8 @@
150137
"open": { "type": { "name": "bool" } },
151138
"openOnFocus": { "type": { "name": "bool" }, "default": "false" },
152139
"openText": { "type": { "name": "string" }, "default": "'Open'" },
153-
"PaperComponent": {
154-
"type": { "name": "elementType" },
155-
"default": "Paper",
156-
"deprecated": true,
157-
"deprecationInfo": "Use <code>slots.paper</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
158-
},
159-
"PopperComponent": {
160-
"type": { "name": "elementType" },
161-
"default": "Popper",
162-
"deprecated": true,
163-
"deprecationInfo": "Use <code>slots.popper</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
164-
},
140+
"PaperComponent": { "type": { "name": "elementType" }, "default": "Paper" },
141+
"PopperComponent": { "type": { "name": "elementType" }, "default": "Popper" },
165142
"popupIcon": { "type": { "name": "node" }, "default": "<ArrowDropDownIcon />" },
166143
"readOnly": { "type": { "name": "bool" }, "default": "false" },
167144
"renderGroup": {

docs/pages/material-ui/api/avatar.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
"children": { "type": { "name": "node" } },
55
"classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
66
"component": { "type": { "name": "elementType" } },
7-
"imgProps": {
8-
"type": { "name": "object" },
9-
"deprecated": true,
10-
"deprecationInfo": "Use <code>slotProps.img</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
11-
},
7+
"imgProps": { "type": { "name": "object" } },
128
"sizes": { "type": { "name": "string" } },
139
"slotProps": {
1410
"type": { "name": "shape", "description": "{ img?: func<br>&#124;&nbsp;object }" },

docs/pages/material-ui/api/backdrop.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,7 @@
3838
},
3939
"additionalInfo": { "sx": true }
4040
},
41-
"TransitionComponent": {
42-
"type": { "name": "elementType" },
43-
"default": "Fade",
44-
"deprecated": true,
45-
"deprecationInfo": "Use <code>slots.transition</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
46-
},
41+
"TransitionComponent": { "type": { "name": "elementType" }, "default": "Fade" },
4742
"transitionDuration": {
4843
"type": {
4944
"name": "union",

docs/pages/material-ui/api/speed-dial.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,15 @@
4444
},
4545
"additionalInfo": { "sx": true }
4646
},
47-
"TransitionComponent": {
48-
"type": { "name": "elementType" },
49-
"default": "Zoom\n* @deprecated Use `slots.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/)",
50-
"deprecated": true,
51-
"deprecationInfo": "Use <code>slots.transition</code> instead. This prop will be removed in v7. <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">How to migrate</a>"
52-
},
47+
"TransitionComponent": { "type": { "name": "elementType" }, "default": "Zoom" },
5348
"transitionDuration": {
5449
"type": {
5550
"name": "union",
5651
"description": "number<br>&#124;&nbsp;{ appear?: number, enter?: number, exit?: number }"
5752
},
5853
"default": "{\n enter: theme.transitions.duration.enteringScreen,\n exit: theme.transitions.duration.leavingScreen,\n}"
5954
},
60-
"TransitionProps": {
61-
"type": { "name": "object" },
62-
"deprecated": true,
63-
"deprecationInfo": "Use <code>slotProps.transition</code> instead. This prop will be removed in v7. <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">How to migrate</a>"
64-
}
55+
"TransitionProps": { "type": { "name": "object" } }
6556
},
6657
"name": "SpeedDial",
6758
"imports": [

docs/pages/material-ui/api/step-label.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,8 @@
2222
"type": { "name": "shape", "description": "{ label?: elementType, stepIcon?: elementType }" },
2323
"default": "{}"
2424
},
25-
"StepIconComponent": {
26-
"type": { "name": "elementType" },
27-
"deprecated": true,
28-
"deprecationInfo": "Use <code>slots.stepIcon</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
29-
},
30-
"StepIconProps": {
31-
"type": { "name": "object" },
32-
"deprecated": true,
33-
"deprecationInfo": "Use <code>slotProps.stepIcon</code> instead. This prop will be removed in v7. See <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">Migrating from deprecated APIs</a> for more details."
34-
},
25+
"StepIconComponent": { "type": { "name": "elementType" } },
26+
"StepIconProps": { "type": { "name": "object" } },
3527
"sx": {
3628
"type": {
3729
"name": "union",

packages/mui-codemod/src/deprecations/all/deprecations-all.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import transformAccordionClasses from '../accordion-summary-classes';
2-
import transformAccordionProps from '../accordion-props';
32
import transformAlertClasses from '../alert-classes';
43
import transformAvatarGroupProps from '../avatar-group-props';
54
import transformAutocompleteProps from '../autocomplete-props';
6-
import transformAvatarProps from '../avatar-props';
75
import transformBackdropProps from '../backdrop-props';
86
import transformButtonClasses from '../button-classes';
97
import transformButtonGroupClasses from '../button-group-classes';
@@ -18,7 +16,6 @@ import transformInputProps from '../input-props';
1816
import transformModalProps from '../modal-props';
1917
import transformOutlinedInputProps from '../outlined-input-props';
2018
import transformPaginationItemClasses from '../pagination-item-classes';
21-
import transformSpeedDialProps from '../speed-dial-props';
2219
import transformTableSortLabelClasses from '../table-sort-label-classes';
2320
import transformStepConnectorClasses from '../step-connector-classes';
2421
import transformStepLabelProps from '../step-label-props';
@@ -32,11 +29,9 @@ import transformToggleButtonGroupClasses from '../toggle-button-group-classes';
3229
*/
3330
export default function deprecationsAll(file, api, options) {
3431
file.source = transformAccordionClasses(file, api, options);
35-
file.source = transformAccordionProps(file, api, options);
3632
file.source = transformAlertClasses(file, api, options);
3733
file.source = transformAvatarGroupProps(file, api, options);
3834
file.source = transformAutocompleteProps(file, api, options);
39-
file.source = transformAvatarProps(file, api, options);
4035
file.source = transformBackdropProps(file, api, options);
4136
file.source = transformButtonClasses(file, api, options);
4237
file.source = transformButtonGroupClasses(file, api, options);
@@ -51,7 +46,6 @@ export default function deprecationsAll(file, api, options) {
5146
file.source = transformModalProps(file, api, options);
5247
file.source = transformOutlinedInputProps(file, api, options);
5348
file.source = transformPaginationItemClasses(file, api, options);
54-
file.source = transformSpeedDialProps(file, api, options);
5549
file.source = transformStepConnectorClasses(file, api, options);
5650
file.source = transformStepLabelProps(file, api, options);
5751
file.source = transformTableSortLabelClasses(file, api, options);

0 commit comments

Comments
 (0)