From Control Flashcards

1
Q

How do controlled components differ from uncontrolled components?

A

controlled components refer to components that have their state and behavior controlled by the parent component.

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

No component re-renders., Browser DOM handles the changes to the element., Simple 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

The UI and the data are in sync., Form data can be passed between different components.

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

Which style do you prefer?

A

uncontrolled

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