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

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

Open
mj12albert opened this issue Oct 3, 2023 · 0 comments
Open

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

mj12albert opened this issue Oct 3, 2023 · 0 comments
Assignees
Labels
component: FormControl The React component

Comments

@mj12albert
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: FormControl The React component
Projects
Status: Backlog
Development

No branches or pull requests

3 participants