How to remove the new firebase onAuthStateChanged listener in react
问题 I'm implementing firebase auth in a react web app with react-router. A user signs in (at /signin) with either Facebook or Google using the popup sign in, then if successful I route to the main app (/). In the main app component I listen for an auth state change: componentWillMount() { this.authListener = this.authListener.bind(this); this.authListener(); } authListener listens for the auth change: authListener() { firebase.auth().onAuthStateChanged((user) => { if (user) { console.log('user