From d37e2df4fb6be2d4f36f66c34f9dad2cdb77ade6 Mon Sep 17 00:00:00 2001 From: Atharva Date: Thu, 19 Mar 2026 10:53:20 +0530 Subject: [PATCH 1/4] removed deprecated props from FormControlLabel --- .../migration/upgrade-to-v9/upgrade-to-v9.md | 19 +++++++++++++++++++ .../material-ui/api/form-control-label.json | 6 ------ .../form-control-label.json | 1 - .../FormControlLabel/FormControlLabel.d.ts | 15 --------------- .../src/FormControlLabel/FormControlLabel.js | 14 +------------- .../FormControlLabel/FormControlLabel.test.js | 4 ++-- 6 files changed, 22 insertions(+), 37 deletions(-) diff --git a/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md b/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md index 48cc314c13bb0b..1ce9b691912632 100644 --- a/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md +++ b/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md @@ -759,3 +759,22 @@ The following deprecated props have been removed: + }} /> ``` + +#### FormControlLabel deprecated props removed + +Use the [form-control-label-props codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#form-control-label-props) below to migrate the code as described in the following section: + +```bash +npx @mui/codemod@latest deprecations/form-control-label-props +``` + +The following deprecated prop has been removed: + +- `componentsProps` — use `slotProps` instead + +```diff + +``` diff --git a/docs/pages/material-ui/api/form-control-label.json b/docs/pages/material-ui/api/form-control-label.json index 97efca9b3f25bd..ad18d29326750f 100644 --- a/docs/pages/material-ui/api/form-control-label.json +++ b/docs/pages/material-ui/api/form-control-label.json @@ -3,12 +3,6 @@ "control": { "type": { "name": "element" }, "required": true }, "checked": { "type": { "name": "bool" } }, "classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } }, - "componentsProps": { - "type": { "name": "shape", "description": "{ typography?: object }" }, - "default": "{}", - "deprecated": true, - "deprecationInfo": "use the slotProps prop instead. This prop will be removed in a future major release. See Migrating from deprecated APIs for more details." - }, "disabled": { "type": { "name": "bool" } }, "disableTypography": { "type": { "name": "bool" } }, "inputRef": { "type": { "name": "custom", "description": "ref" } }, diff --git a/docs/translations/api-docs/form-control-label/form-control-label.json b/docs/translations/api-docs/form-control-label/form-control-label.json index ba97bc9e379b6a..323f3de521880e 100644 --- a/docs/translations/api-docs/form-control-label/form-control-label.json +++ b/docs/translations/api-docs/form-control-label/form-control-label.json @@ -3,7 +3,6 @@ "propDescriptions": { "checked": { "description": "If true, the component appears selected." }, "classes": { "description": "Override or extend the styles applied to the component." }, - "componentsProps": { "description": "The props used for each slot inside." }, "control": { "description": "A control element. For instance, it can be a Radio, a Switch or a Checkbox." }, diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts index dfd12b38988900..1744421455bc6b 100644 --- a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts +++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts @@ -34,21 +34,6 @@ export interface FormControlLabelProps * Override or extend the styles applied to the component. */ classes?: Partial | undefined; - /** - * The props used for each slot inside. - * @default {} - * @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. - */ - componentsProps?: - | { - /** - * Props applied to the Typography wrapper of the passed label. - * This is unused if disableTypography is true. - * @default {} - */ - typography?: TypographyProps | undefined; - } - | undefined; /** * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`. */ diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.js b/packages/mui-material/src/FormControlLabel/FormControlLabel.js index 84a38814293ca8..9269a96abf2c8e 100644 --- a/packages/mui-material/src/FormControlLabel/FormControlLabel.js +++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.js @@ -114,7 +114,6 @@ const FormControlLabel = React.forwardRef(function FormControlLabel(inProps, ref const { checked, className, - componentsProps = {}, control, disabled: disabledProp, disableTypography, @@ -164,10 +163,7 @@ const FormControlLabel = React.forwardRef(function FormControlLabel(inProps, ref const externalForwardedProps = { slots, - slotProps: { - ...componentsProps, - ...slotProps, - }, + slotProps, }; const [TypographySlot, typographySlotProps] = useSlot('typography', { @@ -228,14 +224,6 @@ FormControlLabel.propTypes /* remove-proptypes */ = { * @ignore */ className: PropTypes.string, - /** - * The props used for each slot inside. - * @default {} - * @deprecated use the `slotProps` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details. - */ - componentsProps: PropTypes.shape({ - typography: PropTypes.object, - }), /** * A control element. For instance, it can be a `Radio`, a `Switch` or a `Checkbox`. */ diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js b/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js index f421b3430e9b6a..826c8b47e65b1f 100644 --- a/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js +++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.test.js @@ -191,12 +191,12 @@ describe('', () => { }); }); - describe('componentsProps: typography', () => { + describe('slotProps: typography', () => { it('should spread its contents to the typography element', () => { render( Date: Thu, 19 Mar 2026 11:18:09 +0530 Subject: [PATCH 2/4] remove unused imports --- .../mui-material/src/FormControlLabel/FormControlLabel.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts index 1744421455bc6b..40f2acbf043d4c 100644 --- a/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts +++ b/packages/mui-material/src/FormControlLabel/FormControlLabel.d.ts @@ -2,7 +2,7 @@ import * as React from 'react'; import { SxProps } from '@mui/system'; import { Theme } from '../styles'; import { InternalStandardProps as StandardProps } from '../internal'; -import Typography, { TypographyProps } from '../Typography'; +import Typography from '../Typography'; import { FormControlLabelClasses } from './formControlLabelClasses'; import { CreateSlotsAndSlotProps, SlotProps } from '../utils/types'; From b8be862c7437608ef7d66e462d6fdb5aa1c5916e Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Thu, 19 Mar 2026 14:31:55 +0800 Subject: [PATCH 3/4] tweak doc --- docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md b/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md index 1ce9b691912632..bcc3134b2bda33 100644 --- a/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md +++ b/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md @@ -774,7 +774,7 @@ The following deprecated prop has been removed: ```diff ``` From d2b862ed46b6c2014727bc4a3bfef8acd295f434 Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Thu, 19 Mar 2026 14:56:46 +0800 Subject: [PATCH 4/4] fix ci --- docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md b/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md index f88c0ed8dab6eb..776b18820019be 100644 --- a/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md +++ b/docs/data/material/migration/upgrade-to-v9/upgrade-to-v9.md @@ -784,6 +784,8 @@ The following deprecated prop has been removed: - componentsProps={{ typography: { fontWeight: 'bold' } }} + slotProps={{ typography: { fontWeight: 'bold' } }} /> +``` + #### Typography deprecated CSS classes removed The deprecated `paragraph` CSS class has been removed.