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
2
Q
Why is it important for React components to be data-driven?
A
JavaScript array methods to manipulate an array of data
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
4
Q
What Array method is commonly used to create a list of React components?
A
.map()
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
6
Q
What is the best value to use as a “key” prop when rendering lists?
A
number