react-form-controls Flashcards

1
Q

What are controlled components?

A

Form data that is controlled by the components 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

onChange and value

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

What does setState do?

A
  1. Updates the state, skipping properties not included in the object passed to setState
  2. Calls the render() method
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What happens to the DOM in React and the browser on every render() call?

A
  1. A new React DOM tree is made
  2. The new one looks at the old one and finds what is different
  3. The browser DOM page is patched based on those differences
How well did you know this?
1
Not at all
2
3
4
5
Perfectly