Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,28 @@ Use `sx={{ opacity : "0.6" }}` (or any opacity):
/>
```

#### Popper deprecated props removed

Use the [popper-props codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#popper-props) below to migrate the code as described in the following section:

```bash
npx @mui/codemod@latest deprecations/popper-props <path>
```

The following deprecated props have been removed:

- `components` — use `slots` instead
- `componentsProps` — use `slotProps` instead

```diff
<Popper
- components={{ Root: CustomRoot }}
- componentsProps={{ root: { className: 'custom' } }}
+ slots={{ root: CustomRoot }}
+ slotProps={{ root: { className: 'custom' } }}
/>
```

#### Tabs deprecated props removed

Use the [tabs-props codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#tabs-props) below to migrate the code as described in the following section:
Expand Down
12 changes: 0 additions & 12 deletions docs/pages/material-ui/api/popper.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,6 @@
},
"children": { "type": { "name": "union", "description": "node<br>&#124;&nbsp;func" } },
"component": { "type": { "name": "elementType" } },
"components": {
"type": { "name": "shape", "description": "{ Root?: elementType }" },
"default": "{}",
"deprecated": true,
"deprecationInfo": "use the <code>slots</code> prop instead. This prop will be removed in a future major release. <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">How to migrate</a>."
},
"componentsProps": {
"type": { "name": "shape", "description": "{ root?: func<br>&#124;&nbsp;object }" },
"default": "{}",
"deprecated": true,
"deprecationInfo": "use the <code>slotProps</code> prop instead. This prop will be removed in a future major release. <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">How to migrate</a>."
},
"container": { "type": { "name": "union", "description": "HTML element<br>&#124;&nbsp;func" } },
"disablePortal": { "type": { "name": "bool" }, "default": "false" },
"keepMounted": { "type": { "name": "bool" }, "default": "false" },
Expand Down
4 changes: 0 additions & 4 deletions docs/translations/api-docs/popper/popper.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
"component": {
"description": "The component used for the root node. Either a string to use a HTML element or a component."
},
"components": {
"description": "The components used for each slot inside the Popper. Either a string to use a HTML element or a component."
},
"componentsProps": { "description": "The props used for each slot inside the Popper." },
"container": {
"description": "An HTML element or function that returns one. The <code>container</code> will have the portal children appended to it.<br>You can also provide a callback, which is called in a React layout effect. This lets you set the container from a ref, and also makes server-side rendering possible.<br>By default, it uses the body of the top-level document object, so it&#39;s simply <code>document.body</code> most of the time."
},
Expand Down
1 change: 0 additions & 1 deletion packages/mui-material/src/Popper/Popper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('<Popper />', () => {
inheritComponent: 'div',
render,
refInstanceof: window.HTMLDivElement,
testLegacyComponentsProp: true,
slots: {
root: {},
},
Expand Down
45 changes: 2 additions & 43 deletions packages/mui-material/src/Popper/Popper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,6 @@ export interface PopperProps extends Omit<BasePopperProps, 'direction'> {
* Either a string to use a HTML element or a component.
*/
component?: React.ElementType | undefined;
/**
* The components used for each slot inside the Popper.
* Either a string to use a HTML element or a component.
*
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
* @default {}
*/
components?:
| {
Root?: React.ElementType | undefined;
}
| undefined;
/**
* The props used for each slot inside the Popper.
*
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
* @default {}
*/
componentsProps?: BasePopperProps['slotProps'] | undefined;
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
Expand Down Expand Up @@ -72,8 +53,6 @@ const Popper = React.forwardRef(function Popper(
const {
anchorEl,
component,
components,
componentsProps,
container,
disablePortal,
keepMounted,
Expand All @@ -88,7 +67,6 @@ const Popper = React.forwardRef(function Popper(
...other
} = props;

const RootComponent = slots?.root ?? components?.Root;
const otherProps = {
anchorEl,
container,
Expand All @@ -106,8 +84,8 @@ const Popper = React.forwardRef(function Popper(
<PopperRoot
as={component}
direction={isRtl ? 'rtl' : 'ltr'}
slots={{ root: RootComponent }}
slotProps={slotProps ?? componentsProps}
slots={slots}
slotProps={slotProps}
{...otherProps}
ref={ref}
/>
Expand Down Expand Up @@ -142,25 +120,6 @@ Popper.propTypes /* remove-proptypes */ = {
* Either a string to use a HTML element or a component.
*/
component: PropTypes.elementType,
/**
* The components used for each slot inside the Popper.
* Either a string to use a HTML element or a component.
*
* @deprecated use the `slots` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
* @default {}
*/
components: PropTypes.shape({
Root: PropTypes.elementType,
}),
/**
* The props used for each slot inside the Popper.
*
* @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).
* @default {}
*/
componentsProps: PropTypes.shape({
root: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
}),
/**
* An HTML element or function that returns one.
* The `container` will have the portal children appended to it.
Expand Down
Loading