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][TextField][FormLabel][InputLabel][FormControl] Use exact children type to allow React children type augmentation #38872

Merged
merged 9 commits into from
Jan 4, 2024
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