react-form-controls Flashcards
1
Q
What are controlled components?
A
Form data that is controlled by the components state.
2
Q
What two props must you pass to an input for it to be “controlled”?
A
onChange and value
3
Q
What does setState do?
A
- Updates the state, skipping properties not included in the object passed to setState
- Calls the render() method
4
Q
What happens to the DOM in React and the browser on every render() call?
A
- A new React DOM tree is made
- The new one looks at the old one and finds what is different
- The browser DOM page is patched based on those differences