Vue · Middle · Question 58 of 75

You mutate an array inside a shallowRef. Why doesn't the view update, and how do you fix it?

const rows = shallowRef([])
rows.value.push(newRow)

Explanation

shallowRef skips deep reactivity for performance; you decide when the change is announced.

Further reading

Problem with a question

Vue · Middle · question 58

Test yourself

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

Take this quiz