title: Why does my firebase onAuthStateChanged() trigger multiple times? (React Native)
body: <p>My <code>firebase</code> method <code>onAuthStateChanged()</code> trigger several times when I sign in and out using <code>firebase-authentication</code> according to <code>console.log</code>. Isn't it supposed to trigger only once at login and once at logout. The result is that when signing out, the navigation to a previous page is triggered several times. Here's the code: </p>
  
  <pre><code>componentDidMount() {
      fbAuth.onAuthStateChanged(user =&gt; this.loginFunc(user));
  }
  
  loginFunc(user) {
     if (user) {
       console.log('LOGGED IN');
  }else {
    console.log('LOGGED OUT');
    this.props.navigation.navigate('FbLogin');
  }
  console.log('onAUTH LOGGED IN: ', user);
  }
  </code></pre>
  
  <p>This is what the console looks like. As you can see both login and logout are triggered on just a single logout click. On login, it triggers twice....</p>
  
  <pre><code>LOGGED OUT
  FbLogin.js:46 onAUTH:  null
  LoggedIn.js:27 LOGGED OUT
  LoggedIn.js:30 onAUTH LOGGED IN:  null
  FbLogin.js:44 LOGGED OUT
  FbLogin.js:46 onAUTH:  null
  </code></pre>
  
  <p>My logout button looks like this:</p>
  
  <pre><code>&lt;TouchableHighlight //LOGOUT
     style={{
        ...
     }}
     onPress={() =&gt; {
        fbAuth.signOut();
        this.setState({ loginState: "You are logged out" });
     }}
     &gt;
        &lt;Text&gt;Logout&lt;/Text&gt;
     &lt;/TouchableHighlight&gt;
  </code></pre>