A controlled input reads its value from state and updates that state in onChange. Validation and displayed text can derive from the same source.
The demo follows a keystroke from event to state and back to the screen. Since every keystroke updates state, move it into a smaller component if a large subtree also renders.
When to use
Use it for live validation, conditional UI, or coordination between fields.