title: React Native Firebase authentication error handling
body: <p>How to set state <code>('this.setState({})')</code> inside error handling function for Firebase auth? </p>
  
  <p>its not working in React Native.</p>
  
  <pre><code>  onSignUpPress() {
      if (this.state.password !== this.state.passwordConfirmation ) {
        return this.setState({errorMessage: 'Your passwords do not match'});
      }
  
        ref.createUser({
          email    : this.state.email,
          password : this.state.password
        }, function(error, authData) {
          if (error) {
              console.log(error);
              // this.setState({errorMsg: error}) &lt;-- Like this, it not work on React Native.
          } else {
              console.log("Successfully created user account with uid:", userData.uid);
          }
      });
    }
  });
  </code></pre>