Vue · Junior · Question 14 of 75

What does reactive() return?

const state = reactive({ count: 0, user: { name: "Ann" } });
state.count++;

Explanation

reactive only works with objects, arrays and collections - not primitives. The Vue docs recommend ref as the primary API because it works with any value type.

Further reading

Problem with a question

Vue · Junior · question 14

Test yourself

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

Take this quiz