Rendering Lists Flashcards

1
Q

When would we want to create a list of React components?

A

want to display multiple similar components from a collection of data

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

Why is it important for React components to be data-driven?

A

JavaScript array methods to manipulate an array of data

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

Where in the component code would a list of React components typically be built?

A

inside of a data component or local storage

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

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

A

.map()

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

Why do components in a list need to have unique keys?

A

a string or a number that uniquely identifies it among other items in that array

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

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

A

number

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