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

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

so the only thing that changes is the needed field.

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 the function body

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

to help match later if the list needs to be dynamic

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

The ID in the DB table

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