Vue · Senior · Question 14 of 75

Why can passing activeId to every list item make large lists slow?

<ListItem v-for="item in list" :key="item.id" :id="item.id" :active-id="activeId" />

Explanation

Child components update when any prop changes. Keeping props stable means only the two items whose active flag flips will re-render.

Further reading

Problem with a question

Vue · Senior · question 14

Test yourself

Take the Vue · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz