Skip to content

Issue with nested state change reactivity #2608

Closed Answered by posva
mudmixer-wes asked this question in Help and Questions
Discussion options

You must be logged in to vote

You lose reactivity if you destructure the store:

const { fields, reset } = useFormState()

You should just do store = useFormState() and use store.fields when needed. If you really need to extract them see https://pinia.vuejs.org/core-concepts/#Destructuring-from-a-Store

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by posva
Comment options

You must be logged in to vote
2 replies
@posva
Comment options

@mudmixer-wes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants