What this thread does
Do first: initialize controlled text with useState('') so the first render cannot pass an undefined value while asynchronous data is loading.
Short answer
As of November 2026, React 19.3.1 retains the control-mode rule: a text value stays a string; checkbox checked stays boolean (input). The warning A component is changing an uncontrolled input to be controlled means an earlier render supplied no defined controlling value.
Choose / don't choose
- Controlled: choose when React must own current edits, validation or resets.
- Uncontrolled: choose
defaultValuefor initial text specified only as an initial value; the initial value does not control what the value should be right now (input). - Late server data: choose an explicit application policy: initialize a new editing session, or preserve an existing dirty draft. Do not silently copy every server update into the draft (derived-state guidance).
Not for: class-to-hooks migration planning; see react-class-to-hooks-codemod-then-e2e.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
useState('') | Empty string from the first render; initializer is ignored after mounting | React 19.3 docs | State |
value | someValue ?? '' for missing text | React 19.3 docs | Input |
checked | Always boolean; application fallback for missing state: false | React 19.3 docs | Input |
defaultValue / defaultChecked | Initial string / boolean only, for uncontrolled inputs | React 19.3 docs | Input |
onChange | Synchronously copy e.target.value for text or e.target.checked for a checkbox | React 19.3 docs | Input |
key | Deliberately change for a new record if the whole form should reset | React 19.3 docs | Form reset |
Order of operations
1. Mount with defined controlled state, or wait for data before mounting an uncontrolled editor. 2. Apply each keystroke immediately to the draft; do not postpone the input state update until a request completes (input). 3. Decide how the fetched record starts an editing session. Application policy derived from state preservation: mount an editor with loaded initial data and an explicit identity with key; preserve that instance during background refresh so refreshed defaults do not reset edits (identity). 4. If loading while editing is allowed instead, explicitly retain a dirty draft and ignore stale initialization responses. React's state API does not choose this merge policy for you. Changing the initializer later cannot update an already-mounted state value (state).
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
uncontrolled input | First render uses an absent field; a later render supplies text | Trace the first render's value; provide a string throughout | Input, alexs333's May 25, 2016 report |
Diagnostic: uncontrolled input
Inspect the initial state object and the exact prop passed before the fetch resolves, rather than only inspecting the populated render.
Missing
- Whether a background response should merge, replace or preserve dirty edits is product behavior; the APIs provide no universal merge order.
Checked
2026-11-12; React 19.3.1 release and 19.3 docs. Sources read: input, state, preserving state, derived-state guidance, alexs333's question and React issue #4618. No browser execution is claimed.
Started from a post by @React, packaged by the editor. Original post