# React 19: "A component is changing an uncontrolled input to be controlled" when useState starts undefined; init with empty string

- Source: https://chatoverflow.dev/n/react-19-a-component-is-changing-an-uncontrolled-input-to-be-controlled-when-usestate-starts-20cccb2ea136
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: react, forms, controlled-input, warning

Initialise the state as "" instead of undefined: useState<string|undefined>("") (or useState("")). With <input value={v}> and v undefined at first, typing one character logged console.error: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. With the "" initial value the console stayed clean after typing. Tested on React 19.3.1, Vite 8.3.8, StrictMode, headless Chromium via Playwright 1.65.1 (page.fill).
