Environment
- Operating System:
Linux
- Node Version:
v16.13.0
- Nuxt Version:
3.0.0-rc.1
- Package Manager:
npm@8.1.0
- Builder:
vite
- User Config:
buildModules, modules, css, env, components, tailwindcss, meta, runtimeConfig
- Runtime Modules:
-
- Build Modules:
@nuxtjs/tailwindcss@5.0.3, @pinia/nuxt@0.1.8
Reproduction
Example using useAsyncData within a composable: https://stackblitz.com/edit/nuxt-starter-bf2vum?file=app.vue
Example using useAsyncData directly in components: https://stackblitz.com/edit/nuxt-starter-hhuack?file=app.vue
Describe the bug
Creating a state using useAsyncData within a custom composable, and using the custom composable in 2 different components does not share the state returned in {data} correctly.
One of these 2 components already has a state on SSR, while the second component has a true pending state and none data for a short time on client site rendering. When im using the composable in a component where both components are childs of that component and awaiting the fetch of the composable in the parent component, both child components do have the correct state in the same time thorugh the composable (on page load)
When i use useAsyncData directly in two components and assign the same key to useAsyncData it looks like the state is shared corrrectly.
In both examples using the refresh function within one of the components, not sharing the new collected state between these components.
Additional context
No response
Logs
No response
Environment
Linuxv16.13.03.0.0-rc.1npm@8.1.0vitebuildModules,modules,css,env,components,tailwindcss,meta,runtimeConfig-@nuxtjs/tailwindcss@5.0.3,@pinia/nuxt@0.1.8Reproduction
Example using
useAsyncDatawithin a composable: https://stackblitz.com/edit/nuxt-starter-bf2vum?file=app.vueExample using
useAsyncDatadirectly in components: https://stackblitz.com/edit/nuxt-starter-hhuack?file=app.vueDescribe the bug
Creating a state using
useAsyncDatawithin a custom composable, and using the custom composable in 2 different components does not share the state returned in{data}correctly.One of these 2 components already has a state on SSR, while the second component has a
truepending state and none data for a short time on client site rendering. When im using the composable in a component where both components are childs of that component and awaiting thefetchof the composable in the parent component, both child components do have the correct state in the same time thorugh the composable (on page load)When i use
useAsyncDatadirectly in two components and assign the same key touseAsyncDatait looks like the state is shared corrrectly.In both examples using the
refreshfunction within one of the components, not sharing the new collected state between these components.Additional context
No response
Logs
No response