-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
56 lines (46 loc) · 1.08 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import 'core-js/es6/map'
import 'core-js/es6/set'
import React from 'react'
import ReactDOM from 'react-dom'
import {
BrowserRouter as Router,
Route,
Link,
Switch,
IndexRoute
} from 'react-router-dom'
import App from './_components/App'
import { Provider } from 'react-redux'
import { createStore, combineReducers, compose } from 'redux'
import AuthReducer from './__reducers/auth'
require('./node_modules/antd/lib/style/index.less')
require('./node_modules/antd/lib/style/components.less')
require('./css/app.scss')
const rootReducer = combineReducers({
auth: AuthReducer,
})
const store = createStore(
rootReducer,
{
auth: {
isAuthenticated: true
}
}
)
const render = Component => {
ReactDOM.render(
<Provider store={store}>
<div className="app">
<Router basename={'/'}>
<Route path="" component={Component} />
</Router>
</div>
</Provider>,
document.getElementById('root'),
)
}
render(App)
// Webpack Hot Module Replacement API
if (module.hot) {
module.hot.accept('./_components/App', () => { render(App) })
}