Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: useMutation outside setup #1262

Merged
merged 1 commit into from
Sep 21, 2021
Merged

fix: useMutation outside setup #1262

merged 1 commit into from
Sep 21, 2021

Conversation

d18n
Copy link
Contributor

@d18n d18n commented Sep 21, 2021

I was trying to run a mutation outside of setup, and was getting a warning saying onBeforeUnmount is called when there is no active component instance to be associated with

It looks like we're already doing something similar inside of useQuery.ts, just added a similar check to see if vm is set before calling the lifecycle method

@Akryum Akryum changed the title useMutation outside setup fix: useMutation outside setup Sep 21, 2021
@Akryum Akryum merged commit 9b3af01 into vuejs:v4 Sep 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants