React Rendering Lists Flashcards
1
Q
When would we want to create a list of React components?
A
When you have data that updates periodically
2
Q
Why is it important for React components to be data-driven?
A
so the only thing that changes is the needed field.
3
Q
Where in the component code would a list of React components typically be built?
A
inside the function body
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
to help match later if the list needs to be dynamic
6
Q
What is the best value to use as a “key” prop when rendering lists?
A
The ID in the DB table