Skip to content

Do I need to return **all** refs from the setup store? #2711

Discussion options

You must be logged in to vote
  1. Yes, all ref and reactive calls inside the store must be returned
  2. This article should help: https://masteringpinia.com/blog/how-to-create-private-state-in-stores
  3. The limitation does not come from effectScope. It's about pinia detecting state properties or not. The article explains the cases where this breaks

Regarding your example, any storeToRefs() implies an already existing reactive state, so you don't return that, it would duplicate the state in pinia.state.value

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ilanaya
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants