Skip to content

Instantly share code, notes, and snippets.

@Wellers0n
Created May 27, 2019 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wellers0n/2c0c5d690f013920c7d86e789b573d80 to your computer and use it in GitHub Desktop.
Save Wellers0n/2c0c5d690f013920c7d86e789b573d80 to your computer and use it in GitHub Desktop.
Routes
import React from 'react'
import Home from './screens/Home'
import PrivateRouter from './components/privateRouter'
import Login from './screens/Login'
import {BrowserRouter, Switch, Route} from 'react-router-dom'
const Router = () => {
return (
<BrowserRouter>
<div>
<Switch>
<Route path="/" exact component={Login} />
<PrivateRouter path="/home" component={Home} />
</Switch>
</div>
</BrowserRouter>
)
}
export default Router
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment