What are controlled components?

DWQA QuestionsCategory: Web Design HTMLWhat are controlled components?
Editor Staff asked 2 weeks ago

What are controlled components?

1 Answers
Editor Staff answered 2 weeks ago

A component that controls the input elements within the forms on subsequent user input is called Controlled Component, i.e, every state mutation will have an associated handler function.
For example, to write all the names in uppercase letters, we use handleChange as below,

handleChange(event) {
  this.setState({value: event.target.value.toUpperCase()})
}