react-forms Flashcards

1
Q

What are controlled components?

A

An input form element whose value is controlled by React (making value=this.state.value–the state will always be in control)

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

value, onChange

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

What Array method is commonly used to create a list of React elements?

A

.map

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

What is the best value to use as a “key” prop when rendering lists?

A

key is to use a string that uniquely identifies a list item among its siblings. Most often you would use IDs from your data as keys:

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