Skip to content

Can not pass mutation of useAuthSignOut as dependencies of useEffect #91

Open
@juliushuck

Description

@juliushuck

I want to do this:

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    react-query-firebaseIssue is specific to React Query Firebase branch

    Type

    No type

    Projects

    Status

    Opened

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions