NuxtN
Nuxt15mo ago
Mediv0

What is the best way to use pinia with useAsyncData

I have a very simple component like this:


<script setup lang="ts">
const { fetchNotifications, notifications } = useNotificationsStore();
const { status, refresh } = await useLazyAsyncData(async () => fetchNotifications("DEFAULT").then(() => true));
</script>

<template>
    <p v-if="status === 'success'">
        <span v-for="(notif, i) in notifications" :key="i">
            {{ notif.context }}
        </span>
    </p>
</template>


but it always causes Hydration completed but contains mismatches.
what is the best way to get this data
Was this page helpful?