-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
38 lines (30 loc) · 1.15 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
import React from 'react';
import { render } from 'react-dom';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import articlesApp from './reducers';
import thunkMiddleware from 'redux-thunk';
import { createLogger } from 'redux-logger';
import { Route, HashRouter } from 'react-router-dom';
import App from './components/App';
import Index from './components/Index';
import CreateArticle from './containers/CreateArticle';
import 'bootstrap/dist/css/bootstrap.css';
import 'font-awesome/css/font-awesome.css';
import './index.css';
const loggerMiddleware = createLogger();
let createStoreWithMiddleware = applyMiddleware(thunkMiddleware, loggerMiddleware)(createStore);
let store = createStoreWithMiddleware(articlesApp);
let rootElement = document.getElementById('root');
render(
<Provider store={store}>
<HashRouter basename={'/'}>
<div>
<Route path="/login" component={App}/>
<Route path="/new-article" component={CreateArticle}/>
<Route exact path="/" component={Index}/>
</div>
</HashRouter>
</Provider>,
rootElement
);