React-form-controls Flashcards
1
Q
How do controlled components differ from uncontrolled components?
A
controlled: the parent of the element is in change of the states
uncontrolled: the element is in charge of the states
2
Q
What are some advantages of using uncontrolled components?
A
don’t have to maintain states(simpler to use)
3
Q
What are some advantages of using controlled components?
A
data between UI and forms are in sync. EX: Live search bar
4
Q
Which style do you prefer?
A
No preference.
5
Q
What two props must you pass to an input for it to be “controlled”?
A
useState, onChange
6
Q
What are some popular npm packages for creating forms in React?
A
React Hook Form, Formik, React Final Form