What are controlled components in React?
Instruction: Describe the concept of controlled components and how they differ from uncontrolled components.
Context: This question assesses the candidate's understanding of controlled components and their significance in form handling.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
An input is controlled when React supplies its current value or checked state. The owner updates that value in response to interaction, so other UI can use the same state immediately. The owner may be a parent; the input component does not have to keep its own copy.
For text, initialize the controlled value to a string and update it synchronously from onChange...