How to redirect to a specific page according to a condition in React-Router 4
问题 How to redirect to a specific page according to a condition in "react-router": "^4.0.0" . var { HashRouter, Route, Switch} = require('react-router-dom'); var {Provider} = require('react-redux'); firebase.auth().onAuthStateChanged((user) => { if (user){ this.props.history.push('/todos/'); }else{ this.props.history.push('/'); } }); store.dispatch(actions.startAddTodos()); ReactDOM.render( <Provider store = {store}> <div> <HashRouter> <div> <div className="columns medium-6 large-4 small-centered