-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
41 lines (38 loc) · 1.18 KB
/
index.js
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
37
38
39
40
41
/** global document, Raven */
import React from 'react';
import ReactDOM from 'react-dom';
import Loadable from 'react-loadable';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
import App from './routes';
import configureStore from './store';
import GlobalStyle from './GlobalStyle';
import OfflineNotifier from './OfflineNotifier';
import ErrorBoundary from './views/HomePage/ErrorBoundary';
// eslint-disable-next-line no-underscore-dangle
const preloadedState = window.__PRELOADED_STATE__;
const store = configureStore(preloadedState); // Initial State can be passed here
// eslint-disable-next-line
if (__ENV__ === 'PRODUCTION' && typeof Raven !== 'undefined') {
// eslint-disable-next-line
Raven.config('https://[email protected]/1235360', {
release: '0-0-0',
environment: 'production'
}).install();
}
Loadable.preloadReady().then(() => {
ReactDOM.render(
<Provider store={store}>
<BrowserRouter>
<React.Fragment>
<GlobalStyle />
<OfflineNotifier />
<ErrorBoundary>
<App />
</ErrorBoundary>
</React.Fragment>
</BrowserRouter>
</Provider>,
document.getElementById('root')
);
});