1

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
  • 6,740
  • 4
  • 37
  • 54
Luigi
  • 146
  • 1
  • 5
  • You might get information from this https://stackoverflow.com/questions/37427508/react-changing-an-uncontrolled-input – mchowdam May 03 '22 at 11:52
  • 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

0 Answers0