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}) ).
2
Q
What two props must you pass to an input for it to be “controlled”?
A
- value
- onChange