-
Notifications
You must be signed in to change notification settings - Fork 30
/
entry.jsx
36 lines (25 loc) · 888 Bytes
/
entry.jsx
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
33
34
35
36
var React = require("react");
var ReactDOM = require("react-dom");
var routes = require("./routes");
var ReactRouter = require("react-router");
var Router = ReactRouter.Router;
var createBrowserHistory = require("history/lib/createBrowserHistory");
var moment = require("moment");
var analytics = require("./utils/analytics");
require("normalize.css/normalize.css");
require("styles/style.css");
window.React = React; // For chrome dev tool support
moment.locale("ru");
var history = createBrowserHistory();
var flux = require("./fluxy");
function onUpdate() {
analytics.pageView(window.location.pathname);
}
onUpdate();
function createElement(Component, props) {
return <Component {...props} flux={flux} />;
}
ReactDOM.render(
<Router history={ history } createElement={ createElement } onUpdate={ onUpdate }>{ routes }</Router>,
document.getElementById('content')
);