Skip to content

Commit

Permalink
Discourage using controlled inputs in React Native
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon authored Oct 5, 2024
1 parent bf15be9 commit 6bf4309
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/textinput.md
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,8 @@ The color of the `TextInput` underline.

### `value`

> The `value` field implementation is broken in many subtle ways and is not recommended for use. Until these bugs are fixed, we recommend sticking with `defaultValue` and uncontrolled inputs.
The value to show for the text input. `TextInput` is a controlled component, which means the native value will be forced to match this value prop if provided. For most uses, this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. In addition to setting the same value, either set `editable={false}`, or set/update `maxLength` to prevent unwanted edits without flicker.

| Type |
Expand Down

0 comments on commit 6bf4309

Please sign in to comment.