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

[docs] Remove useFormControl return values from demos page #37036

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions docs/data/base/components/form-control/form-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,6 @@ Note that even though Form Control supports both controlled and uncontrolled-sty
(i.e. it accepts `value` and `defaultValue` props), `useFormControlContext` returns only the controlled `value`.
This way, you don't have to implement both in your custom input—Form Control does this for you.

`useFormControlContext` returns an object with the following fields:

| Name | Type | Description |
| :--------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `disabled` | boolean | Represents the value of the FormControl's `disabled` prop. |
| `error` | boolean | Represents the value of the Form Control component's `error` prop. Note that it is not calculated automatically (i.e. it's not set when `required: true` and `value: ''`). |
| `filled` | boolean | Set to `true` if `value` is not empty. |
| `focused` | boolean | Set to `true` if the wrapped input has received focus. |
| `required` | boolean | Represents the value of the Form Control component's `required` prop. |
| `value` | unknown | The current value of the form control. |

The following callbacks are also part of the returned object—they are meant to be used when creating custom inputs:

| Name | Type | Description |
| :--------- | :------------------------ | :------------------------------------------------------------ |
| `onChange` | React.ChangeEvent => void | Value change handler. Should be forwarded to the inner input. |
| `onBlur` | () => void | Focus change handler. Should be forwarded to the inner input. |
| `onFocus` | () => void | Focus change handler. Should be forwarded to the inner input. |

## Customization

:::info
Expand Down
Loading