Skip to content

Commit 86b8c52

Browse files
committed
Fix review comments
1 parent 6ce9f78 commit 86b8c52

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

packages/mui-base/src/FormControl/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export type {
88
FormControlRootSlotPropsOverrides,
99
FormControlState,
1010
UseFormControlContextReturnValue,
11-
// for material-next
1211
FormControlOwnProps,
1312
} from './FormControl.types';
1413

packages/mui-material-next/migration.md

+11
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,17 @@ If you need to prevent default on a `key-up` and/or `key-down` event, then besid
132132

133133
This is to ensure that default is prevented when the `ButtonBase` root is not a native button, for example, when the root element used is a `span`.
134134

135+
## FormControl
136+
137+
### Renamed `FormControlState`
138+
139+
The `FormControlState` interface was renamed to `FormControlContextValue`:
140+
141+
```diff
142+
-import { FormControlState } from '@mui/material';
143+
+import { FormControlContextValue } from '@mui/material-next';
144+
```
145+
135146
## InputBase
136147

137148
### Removed `inputProps`

packages/mui-material-next/src/FormControl/FormControl.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ const FormControlRoot = styled('div', {
2828
name: 'MuiFormControl',
2929
slot: 'Root',
3030
overridesResolver: ({ ownerState }, styles) => {
31-
return {
32-
...(styles.root as Record<string, unknown>),
33-
...(styles[`margin${capitalize(ownerState.margin)}`] as Record<string, unknown>),
34-
...(ownerState.fullWidth && styles.fullWidth),
35-
};
31+
return [
32+
styles.root,
33+
styles[`margin${capitalize(ownerState.margin)}`],
34+
ownerState.fullWidth && styles.fullWidth,
35+
];
3636
},
3737
})<{ ownerState: FormControlOwnerState }>(({ ownerState }) => ({
3838
display: 'inline-flex',

packages/mui-material-next/src/FormControl/FormControl.types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export type FormControlProps<
7979
component?: React.ElementType;
8080
};
8181

82-
type MaterialYouOwnerStateKeys =
82+
type MaterialDesignOwnerStateKeys =
8383
| 'classes'
8484
| 'color'
8585
| 'margin'
@@ -89,5 +89,5 @@ type MaterialYouOwnerStateKeys =
8989
| 'variant';
9090

9191
export type FormControlOwnerState = Simplify<
92-
Required<Pick<FormControlOwnProps, MaterialYouOwnerStateKeys>> & FormControlProps
92+
Required<Pick<FormControlOwnProps, MaterialDesignOwnerStateKeys>> & FormControlProps
9393
>;

0 commit comments

Comments
 (0)