Error AtlasError Documentation and Resolution

A component is changing an uncontrolled input to be controlled

A component is changing an uncontrolled input to be controlled.

React detected an input switching between controlled and uncontrolled states, which can lead to inconsistent UI behavior.

React warningruntime
A component is changing an uncontrolled input to be controlled.
  • Input value starts as undefined or null and later becomes defined.
  • State initialization is inconsistent.
  • Form values are conditionally applied.
  • Mixing defaultValue and value props.
  1. Initialize state with a default value like an empty string.
  2. Ensure inputs always receive a defined value prop.
  3. Avoid switching between controlled and uncontrolled modes.
  4. Use either value or defaultValue consistently.
React Docs: Forms
React uncontrolled to controlled input warning: causes and fixes | Error Atlas