-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
39 lines (30 loc) · 1.04 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
import 'bulma/css/bulma.css';
import './style/index.css';
import './style/line-clamp.css';
import './style/flexboxgrid.min.css';
import registerServiceWorker from './registerServiceWorker';
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware } from 'redux';
import { BrowserRouter } from 'react-router-dom';
import thunk from 'redux-thunk';
import promise from 'redux-promise';
import reducers from './reducers';
import { initAuth } from './auth';
import App from './components/App';
const createStoreWithMiddleware = applyMiddleware(thunk, promise)(createStore);
const store = createStoreWithMiddleware(reducers);
registerServiceWorker();
function render(Component) {
ReactDOM.render(
<Provider store={store}>
<BrowserRouter basename={process.env.PUBLIC_URL}>
<App />
</BrowserRouter>
</Provider>
, document.getElementById('root'));
}
initAuth(store.dispatch)
.then(() => render(App))
.catch(error => console.error(error));