title: firebase.auth().setPersistence error of 'Persistence' of undefined
body: <p>I am using Firebase <code>auth</code> to handle authentication of users in a form but am getting this error</p>
  
  <blockquote>
    <p>error of 'Persistence' of undefined</p>
  </blockquote>
  
  <p>when adding <code>firebase.auth().setPersistence</code>.</p>
  
  <pre><code>onSubmit = event =&gt; {
    const { firebase } = this.props;
    const { email, password, remember } = this.state;
    firebase
      .doSignInWithEmailAndPassword(email, password, remember)
      .then(authUser =&gt; {
        firebase.doEmailUpdateUser(authUser);
      })
      .then(() =&gt; {
        this.setState({ error: null });
        navigate(ROUTES.INDEX);
      })
      .catch(error =&gt; {
        this.setState({
          error,
          errorOpen: true
        });
      });
  
    event.preventDefault();
  };
  </code></pre>
  
  <p>Whereas <code>firebase.doSignInWithEmailAndPassword(email, password, remember)</code> is </p>
  
  <pre><code>doSignInWithEmailAndPassword = (email, password, remember) =&gt; {
    this.auth
      .setPersistence(
        `${
          remember
            ? this.auth.Auth.Persistence.LOCAL
            : this.auth.Auth.Persistence.SESSION
        }`
      )
      .then(() =&gt; this.auth.signInWithEmailAndPassword(email, password));
  };
  </code></pre>
  
  <p>for reference <code>this.auth = app.auth();</code></p>
  
  <p>Have I missed something here? What have I done wrong?</p>