Created
April 2, 2019 12:50
-
-
Save MattJonesCreation/5c658b9594414d38319fdfb2cc8b01be to your computer and use it in GitHub Desktop.
This file contains 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
// index.js | |
import React, { Component } from 'react' | |
import ReactDOM from 'react-dom' | |
import { BrowserRouter, Switch, Route } from 'react-router-dom' | |
import UnauthorizedLayout from 'layouts/UnauthorizedLayout' | |
import ErrorLayout from 'layouts/ErrorLayout' | |
import AuthorizedLayout from 'layouts/AuthorizedLayout' | |
import AuthorizedRoute from 'custom-routes/AuthorizedRoute' | |
import GA from 'utils/GoogleAnalytics' | |
class App extends Component { | |
render () { | |
return ( | |
<BrowserRouter> | |
{ GA.init() && <GA.RouteTracker /> } | |
<Switch> | |
<Route path='/auth' component={UnauthorizedLayout} /> | |
<Route path='/error' component={ErrorLayout} /> | |
<AuthorizedRoute path='/' component={AuthorizedLayout} /> | |
</Switch> | |
</BrowserRouter> | |
) | |
} | |
} | |
ReactDOM.render(<App />, document.getElementById('root')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment