Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Backdrop] Deprecate components and componentProps props for v7 #42026

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/pages/material-ui/api/backdrop.json
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
@@ -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={{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test case shouldn't be changed

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
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