From 6bf430933c690f6897794388ad2c61b50d567522 Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 5 Oct 2024 19:07:50 +0900 Subject: [PATCH] Discourage using controlled inputs in React Native --- docs/textinput.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/textinput.md b/docs/textinput.md index 141cdef64ab..d2cc11dc1e3 100644 --- a/docs/textinput.md +++ b/docs/textinput.md @@ -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 |