Skip to content

[FormControl][material-next] New internal form control state hook #39286

Open
@mj12albert

Description

@mj12albert

Follow up to #39032 (comment)

In v6 we can make a new utility that simplifies the usage of formControlState

v5:

const muiFormControl = useFormControl()

const fcs = formControlState({
    props,
    muiFormControl,
    states: ['color', 'disabled'],
});

v6:

const [
  formControlState, // the result of `formControlState()`
  formControlContext, // the result of `useFormControl()`
] = useFormControlState({
  props,
  states: ['color', 'disabled'],
})

(This is internal and does not affect the public useFormControl hook)

Metadata

Metadata

Assignees

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions