forked from OperationCode/operationcode_frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
32 lines (28 loc) · 781 Bytes
/
Copy pathApp.js
File metadata and controls
32 lines (28 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React, { Component } from 'react';
import { Route, Router } from 'react-router';
import createHistory from 'history/createBrowserHistory';
import ReactGA from 'react-ga';
import Home from './scenes/home/home';
class App extends Component {
constructor(props) {
super(props);
this.history = createHistory();
}
componentDidMount() {
if (process.env.NODE_ENV === 'production') {
ReactGA.initialize('UA-75642413-1', { debug: false });
this.history.listen((location) => {
ReactGA.set({ page: location.pathname });
ReactGA.pageview(location.pathname);
});
}
}
render() {
return (
<Router history={this.history} >
<Route path="/" component={Home} />
</Router>
);
}
}
export default App;