-
Notifications
You must be signed in to change notification settings - Fork 0
/
Root.js
35 lines (27 loc) · 1007 Bytes
/
Root.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
import React from 'react';
import {object} from 'prop-types';
import { createStore, applyMiddleware } from 'redux';
import reducers from './reducers/CombineReducers';
import { Provider } from 'react-redux';
import createHistory from 'history/createBrowserHistory';
import { Router, Route, IndexRoute } from 'react-router';
import { routerMiddleware } from 'react-router-redux';
import thunk from 'redux-thunk';
import App from './App';
import ArticleContainer from './js/components/Articles/ArticleContainer';
import ArticleCard from './js/components/Articles/ArticleCard';
const history = createHistory();
// Build the middleware for intercepting and dispatching navigation actions
const middleware = routerMiddleware(history);
let store = createStore(
reducers,
applyMiddleware(middleware, thunk)
);
const Root = () => (
<Provider store={store}>
<Router history={history}>
<Route path="/" component={App}/>
</Router>
</Provider>
);
export default Root;