Skip to content

Fix: with-firebase-authentication maximum update depth exceeded errors #16010

Answered by joejknowles
francisrod01 asked this question in Help
Discussion options

You must be logged in to vote

Hi, yeah, I think you need to return the cancel function from Firebase as the return value for use effect there.

Where it says:

firebase.auth().onIdTokenChanged((user) => {
   //Content omitted
  })

Change that to

const cancelAuthListener = firebase.auth().onIdTokenChanged((user) => {
   //Content omitted
  })

// Rest of function omitted

return cancelAuthListener;

I'll make a PR for this tomorrow

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@francisrod01
Comment options

Answer selected by francisrod01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants