title: Firebase Auth Signout not pushing to homepage in React web app
body: <p>I have a 'sign out' button which obviously deletes the user session when submitted.</p>
  <p>The token gets removed when the button is clicked, and I'm then wanting it to redirect to the homepage once the token is successfully removed. However, it pulls up the following error when the button is clicked:</p>
  <blockquote>
  <p>Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'this.props')</p>
  </blockquote>
  <p>I don't understand why this would be the case, as the code in principle is similar to other functions which call 'this.props.history.push'.</p>
  <p>Here's my component:</p>
  <pre><code>class ProfileBox extends Component {
    constructor(props) {
      super(props)
  
    }
  
    async signOut(e) {
  
      e.preventDefault()
  
      await firebase.auth().signOut().then(function() {
        console.log(&quot;Successfully signed out.&quot;)
  
      }).catch(function(error) {
        console.log(error)
        console.log(&quot;An error occurred&quot;)
      });
  
      this.props.history.push(&quot;/&quot;);
    }
  
    render() {
      return (
  
            &lt;button className=&quot;profile-box-logout&quot; type=&quot;submit&quot; name=&quot;button&quot; onClick={this.signOut}&gt;Logout&lt;/button&gt;
  
      )
    }
  
  }
  </code></pre>
  <p>Can anyone point out what I'm doing wrong?</p>