Created
November 30, 2018 19:07
-
-
Save binhtran04/c90e2262f2cca8afbe2de736c628ef83 to your computer and use it in GitHub Desktop.
App component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import './App.css'; | |
import { BrowserRouter, Switch } from 'react-router-dom'; | |
import Home from './components/Home'; | |
import Dashboard from './components/Dashboard'; | |
import SignIn from './components/SignIn'; | |
import PrivateRoute from './components/PrivateRoute'; | |
import PublicRoute from './components/PublicRoute'; | |
class App extends Component { | |
render() { | |
return ( | |
<BrowserRouter> | |
<Switch> | |
<PublicRoute restricted={false} component={Home} path="/" exact /> | |
<PublicRoute restricted={true} component={SignIn} path="/signin" exact /> | |
<PrivateRoute component={Dashboard} path="/dashboard" exact /> | |
</Switch> | |
</BrowserRouter> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment