React-Rendering-List Flashcards

1
Q

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

A

When we have a collection of data that we want to display using components

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

It allows for data to be applied dynamically when a component is rendered

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

within a callback function of thats passed as an argument of the .map() method

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

the .map() method

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

Keys tell React which array item each component corresponds to, so that it can match them up later.

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

a string or a number value

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