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

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

What are some advantages of using uncontrolled components?

A

don’t have to maintain states(simpler to use)

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

What are some advantages of using controlled components?

A

data between UI and forms are in sync. EX: Live search bar

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

Which style do you prefer?

A

No preference.

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

What two props must you pass to an input for it to be “controlled”?

A

useState, onChange

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

What are some popular npm packages for creating forms in React?

A

React Hook Form, Formik, React Final Form

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