DEV Community

Discussion on: A simple way to redirect react-router-dom

Collapse
 
ebraimcarvalho profile image
Ebraim Carvalho

Thanks for the comment, I forgot to mention that i needed to redirect after logout to Firebase, this snippet code shows more clearly

const logout = () => {
    firebase.logout()
      .then(result => {
        localStorage.removeItem('email')
        history.push('/login')
      })
      .catch(error => console.log('Error: ', error))
  }

In this case, do you recommend other approach?