title: useHistory hook is not working although console doesn't show errors
body: <p>I am trying to navigate to another page after Firebase sign up finishes, so I tried to use useHistory hook to navigate to next page after signing up is successful
  the signing up was successful but the hook doesn't work, the console doesn't show any errors</p>
  <p>and if the hook doesn't work for such case, how can I navigate to next page if sign up was successful?</p>
  <pre><code>    import {useHistory} from 'react-router-dom'
  const history = useHistory();
        function signup(event) {
          console.log({email, password});
          
          firebase.auth().createUserWithEmailAndPassword(email, password)
            .then((user) =&gt; {
              // Signed in 
              // ...
              
              this.history.push('/Quiz')
              console.log(email, password)
              
              firebase.database().ref('users/' + user.uid).set({ email: user.email, password: user.password });
             
            })
            .catch((error) =&gt; {
              var errorCode = error.code;
              var errorMessage = error.message;
              // ..
              console.log(errorMessage)
              
            });
            
        }
  </code></pre>