© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Composable and Cross-Request State pollution - Nuxt
N
Nuxt
•
2y ago
•
1 reply
rtrap
Composable and Cross-Request State pollution
The documentation here
https://nuxt.com/docs/getting-started/state-management#best-practices
tell to not define a ref outside setup and it suggest to use the useState composable
. Question
: If I write a composable that defines a state with
ref
ref
at the root of the module
, and I use this composable only in the setup of components
, shouldn
't it be re
-executed on every request
(and thus avoid pollution issues
)
?
Nuxt
State Management · Get Started with Nuxt
Nuxt provides powerful state management libraries and the useState composable to create a reactive and SSR
-friendly shared state
.
Recent Announcements
Similar Threads
useCookie does share state between layout and component when used in composable
N
Nuxt / ❓・help
2y ago
Custom Module composable state not reset after hot reload
N
Nuxt / ❓・help
15mo ago
Share a component libs internal state via a composable.
N
Nuxt / ❓・help
2y ago