Created
February 2, 2016 00:06
-
-
Save johnferrie/9e43f87df607d115549f 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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import {Router, Route} from 'react-router'; | |
import { createHistory } from 'history'; | |
import config from './config'; | |
import ga from 'react-ga'; | |
import Landing from './pages/Landing'; | |
ga.initialize(config.google.analyticsId); | |
let logPageView = () => { | |
ga.pageview(this.state.location.pathname); | |
}; | |
let routes = ( | |
<Router history={createHistory()} onUpdate={logPageView}> | |
<Route path="/" component={Landing} /> | |
</Router> | |
) | |
ReactDOM.render(routes, document.querySelector('#app')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment