Skip to content

Commit

Permalink
Add deprecation warning to components and componentProps
Browse files Browse the repository at this point in the history
  • Loading branch information
aacevski committed Apr 25, 2024
1 parent c9bef2c commit 6d0b35b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 3 additions & 1 deletion docs/pages/material-ui/api/backdrop.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"component": { "type": { "name": "elementType" } },
"components": {
"type": { "name": "shape", "description": "{ Root?: elementType }" },
"default": "{}"
"default": "{}",
"deprecated": true,
"deprecationInfo": "use the <code>slots</code> prop instead. This prop will be removed in v7. <a href=\"material-ui/migration/migrating-from-deprecated-apis/\">How to migrate</a>"
},
"componentsProps": {
"type": { "name": "shape", "description": "{ root?: object }" },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import Backdrop from '@mui/material/Backdrop';
import { Backdrop as MyBackdrop } from '@mui/material';

<Backdrop TransitionComponent={CustomTransition} />;
<MyBackdrop TransitionComponent={CustomTransition} />;
<Backdrop slots={{
transition: CustomTransition
}} />;
<MyBackdrop slots={{
transition: CustomTransition
}} />;
<Backdrop
TransitionComponent={CustomTransition}
slots={{
root: 'div',
}}
/>;
transition: CustomTransition
}} />;
<MyBackdrop
TransitionComponent={CustomTransition}
slots={{
...outerSlots,
}}
/>;
transition: CustomTransition
}} />;
<Backdrop
TransitionComponent={ComponentTransition}
slots={{
root: 'div',
transition: SlotTransition
}}
/>;
}} />;
// should skip non MUI components
<NonMuiBackdrop TransitionComponent={CustomTransition} />;
6 changes: 2 additions & 4 deletions packages/mui-material/src/Backdrop/Backdrop.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export interface BackdropOwnProps
/**
* The components used for each slot inside.
*
* This prop is an alias for the `slots` prop.
* It's recommended to use the `slots` prop instead.
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
*
* @default {}
*/
Expand All @@ -64,8 +63,7 @@ export interface BackdropOwnProps
* The extra props for the slot components.
* You can override the existing props or add new ones.
*
* This prop is an alias for the `slotProps` prop.
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
* @deprecated use the `slots` prop instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
*
* @default {}
*/
Expand Down

0 comments on commit 6d0b35b

Please sign in to comment.