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

Awaiting for mutation promise makes error and data undefined. #12242

Open
Grsz opened this issue Dec 23, 2024 · 0 comments
Open

Awaiting for mutation promise makes error and data undefined. #12242

Grsz opened this issue Dec 23, 2024 · 0 comments

Comments

@Grsz
Copy link

Grsz commented Dec 23, 2024

If we have const [mutate, { data, error }] = useMutation(), and call mutate() alone, data, and error are populated as expected.

However, when awaiting the result of mutate like mutate().then(() => {}), data, and error are undefined.

I wouldn't expect this behaviour, and cannot seem to find it documented anywhere.

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

No branches or pull requests

1 participant