async created() {
if (process.server) {
try {
const data = // API call to fetch FAQs
this.faqs = data.faqs
console.log(this.faqs, ' server')
} catch (e) {}
} else {
console.log(this.faqs, 'client')
}
},
Consider the above code with Nuxt.js and SSR enabled. I know it is intended behaviour of Vue to call created hook in both SSR and CSR. But as we can see in the above code, the faqs in data object are mutated in server side and stores the result from API. But when hydration takes place in client side this faqs is set to its initial value which is NULL.
Can some explain this behaviour. Thanks in advance !