lundi 26 mars 2018

how to change exact path after successful login

i am making a login page that redirect the user after a successful login to home page i am using react router dom i tried to look for a simple way to do it but i couldn't find :

import Authen from './Pages/Authen';
import Home from './Pages/Home';
import {
  BrowserRouter as Router,
  Route,
  Link
} from 'react-router-dom';
class App extends Component {
  render() {
    return (
  <div className="App"> 

    <Router>
    <div>
      <ul>
      </ul>
      <Route exact path="/" component={Authen}/>
      <Route path="Home" component={Home}/>
    </div>
  </Router>
  </div>

thank you for your help i really appreciate it :)




Aucun commentaire:

Enregistrer un commentaire