title: firebase.auth().onAuthStateChanged() returns undefined in react native
body: <p>I am trying to get the auth status after refreshing the app and previously signing in but <code>firebase.auth().onAuthStateChanged()</code> gives undefined. The motive behind this is to either navigate to home screen or signIn screen by using the auth status.</p>
  <pre><code>import React, {Component} from 'react';
  import {View} from 'react-native';
  import firebase from 'firebase';
  import {connect} from 'react-redux';
  import {Spinner} from '../components/common';
  
  class Switch extends Component {
  
    componentDidMount() {
      const userData = this.checkUser();
      this.switchContent(userData);
    }
    checkUser = () =&gt; {
      firebase.auth().onAuthStateChanged(async (userData) =&gt; {
        return userData;
      });
    };
    switchContent(userData) {
      console.log(userData);
      if (userData) {
        return this.props.persistantSignIn();
      }
      return this.props.navigation.push('SignInForm');
    }
    renderComponent() {
      return (
        &lt;View style={{flex: 1}}&gt;
          &lt;Spinner /&gt;
        &lt;/View&gt;
    }
    render() {
      return &lt;View style={{flex:1}}&gt;{this.renderComponent()}&lt;/View&gt;;
    }
  }
  
  export default connect(null, {persistantSignIn})(Switch);
  </code></pre>