-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
26 lines (24 loc) · 935 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
import React from 'react';
import ReactDOM from 'react-dom';
import Home from './pages/Home';
import UsersMaster from './pages/UsersMaster';
import PostsMaster from './pages/PostsMaster';
import PostNew from './pages/PostNew';
import { createStore, applyMiddleware } from 'redux';
import { Provider } from 'react-redux';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import ReduxPromise from 'redux-promise';
import reducers from './reducers/index';
const store = applyMiddleware(ReduxPromise)(createStore);
ReactDOM.render(
<Provider store={store(reducers)}>
<BrowserRouter>
<Switch>
<Route path="/posts/new" component={PostNew}/>
<Route path="/posts" component={PostsMaster}/>
<Route path="/users" component={UsersMaster}/>
<Route path="/" component={Home}/>
</Switch>
</BrowserRouter>
</Provider>, document.getElementById('root')
);