react-form-controls Flashcards

1
Q

What are controlled components?

A

A controlled component is a way that allows the data in a form element (i.e. the “value” of an “input” form element) to be controlled by user-input by referring to the component’s state and using setState to control the component’s state via the user-input (for example: this.state({ password: event.target.value}) ).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What two props must you pass to an input for it to be “controlled”?

A
  1. value
  2. onChange
How well did you know this?
1
Not at all
2
3
4
5
Perfectly