Vue · Senior · Question 57 of 75

Why does Nuxt warn against calling $fetch directly in <script setup> for page data?

Explanation

Double fetching wastes requests and can cause hydration mismatches. $fetch is fine in event handlers.

Further reading

Problem with a question

Vue · Senior · question 57

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