-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.js
32 lines (26 loc) · 922 Bytes
/
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
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import {BrowserRouter} from 'react-router-dom';
import 'antd/dist/antd.css';
import '../node_modules/font-awesome/css/font-awesome.min.css';
import '../node_modules/toastr/build/toastr.min.css';
import registerServiceWorker from './registerServiceWorker';
//redux
import configureStore from './redux/store/store';
import {Provider} from 'react-redux';
import {checkForUser} from './redux/actions/userAction';
import {getInitialCart} from './redux/actions/cartActions';
export const store = configureStore();
store.dispatch(checkForUser());
store.dispatch(getInitialCart());
const WithRouter = () => (
<Provider store={store}>
<BrowserRouter>
<App />
</BrowserRouter>
</Provider>
);
ReactDOM.render(<WithRouter />, document.getElementById('root'));
registerServiceWorker();