Created
November 10, 2017 16:40
-
-
Save quiaro/85117696430d989e686d571694a73293 to your computer and use it in GitHub Desktop.
React App with two Routes
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 from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; | |
| import './index.css'; | |
| import Home from './Home'; | |
| import LoginCallback from './LoginCallback'; | |
| import registerServiceWorker from './registerServiceWorker'; | |
| ReactDOM.render( | |
| <Router> | |
| <Switch> | |
| <Route path="/callback" component={LoginCallback} /> | |
| <Route path="/" component={Home} /> | |
| </Switch> | |
| </Router>, | |
| document.getElementById('root') | |
| ); | |
| registerServiceWorker(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment