react-form-controls Flashcards

1
Q

What are controlled components?

A

A controlled component is a component that renders form elements and controls them by keeping the form data in the component’s state. In a controlled component, the form element’s data is handled by the React component (not DOM) and kept in the component’s state.

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

Value and onChange.

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