2

When dealing with forms or inputs in React, everyone's probably come across the following warning:

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. Decide between using a controlled or uncontrolled input element for the lifetime of the component.

Why is it important for components not to change from Uncontrolled to Controlled, or vice versa? I understand that they are just warnings and that they are there for a reason, so you should fix it.

But what is the reason to fix it? Why should that not happen?

Alejandro
  • 7,290
  • 4
  • 34
  • 59
Luigi
  • 403
  • 3
  • 8
  • You might get information from this https://stackoverflow.com/questions/37427508/react-changing-an-uncontrolled-input – mc-user May 03 '22 at 11:52
  • 1
    The answers explain different ways of _how_ to solve it, but no insight into _why_ it matters that it's solved – Luigi May 05 '22 at 12:25
  • I am surprised that this question did not receive any attention over the past year. – Qwerty May 29 '23 at 01:17

0 Answers0