Vue · Senior · Question 58 of 75

Why use Nuxt's useState instead of a module-level ref for shared state?

Explanation

Module-level state is a classic cross-request leak in SSR. Pinia with Nuxt is also request-scoped.

Further reading

Problem with a question

Vue · Senior · question 58

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