invertase / invertase/tanstack-query-firebase

Can not pass mutation of useAuthSignOut as dependencies of useEffect

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
react-query-firebase
Dominant language
TypeScript
Stars
462
Forks
69
PR merge metrics
No merged PRs in 30d

Description

I want to do this:

```js
const mutation = useAuthSignOut(firebaseAuth);

useEffect(() => {
mutation.mutate();
}, [mutation]); // Can not pass in mutation as a dependency
```

But when I do so, the page freezes.

I have to remove it from the dependencies array to make it work. Why is that?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.