React-Rendering-List Flashcards
When would we want to dynamically create a list of React components?
When we have a collection of data that we want to display using components
Why is it important for React components to be data-driven?
It allows for data to be applied dynamically when a component is rendered
Where in the component code would a list of React components typically be built?
within a callback function of thats passed as an argument of the .map() method
What Array method is commonly used to create a list of React components?
the .map() method
Why do components in a list need to have unique keys?
Keys tell React which array item each component corresponds to, so that it can match them up later.
What is the best value to use as a “key” prop when rendering lists?
a string or a number value