Skip to content

Commit

Permalink
[material-ui][TextField][FormLabel][InputLabel][FormControl] Use exac…
Browse files Browse the repository at this point in the history
…t children type to allow React children type augmentation (#38872)

Co-authored-by: ZeeshanTamboli <[email protected]>
  • Loading branch information
nicegamer7 and ZeeshanTamboli authored Jan 4, 2024
1 parent 273e721 commit cb76f8f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/mui-material/src/FormControl/FormControl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface FormControlOwnProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
children?: React.HTMLAttributes<HTMLDivElement>['children'];
/**
* Override or extend the styles applied to the component.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/FormLabel/FormLabel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface FormLabelOwnProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
children?: React.LabelHTMLAttributes<HTMLLabelElement>['children'];
/**
* Override or extend the styles applied to the component.
*/
Expand Down
6 changes: 1 addition & 5 deletions packages/mui-material/src/InputLabel/InputLabel.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ import { OverridableComponent, OverrideProps } from '../OverridableComponent';

export interface InputLabelPropsSizeOverrides {}

export interface InputLabelOwnProps {
/**
* The content of the component.
*/
children?: React.ReactNode;
export interface InputLabelOwnProps extends Pick<FormLabelProps, 'children'> {
/**
* Override or extend the styles applied to the component.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-material/src/TextField/TextField.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface BaseTextFieldProps
/**
* @ignore
*/
children?: React.ReactNode;
children?: FormControlProps['children'];
/**
* Override or extend the styles applied to the component.
*/
Expand Down

0 comments on commit cb76f8f

Please sign in to comment.