Remove react-router from tests and create browserHistory manually

This commit is contained in:
Karol Janyst
2017-01-30 12:22:25 +09:00
parent 80e8e768c2
commit bee5105c4d
3 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { browserHistory } from 'react-router';
import { createBrowserHistory } from 'history';
import {
syncHistoryWithStore,
routerReducer,
@@ -15,6 +15,7 @@ import {
const reducer = combineReducers({ routing: routerReducer });
// Apply the middleware to the store
const browserHistory = createBrowserHistory()
const middleware = routerMiddleware(browserHistory);
const store = createStore(
reducer,

View File

@@ -1,10 +1,11 @@
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { browserHistory } from 'react-router';
import { createBrowserHistory } from 'history';
import { syncHistory, routeReducer } from 'react-router-redux';
const reducer = combineReducers({ routing: routeReducer });
// Sync dispatched route actions to the history
const browserHistory = createBrowserHistory()
const reduxRouterMiddleware = syncHistory(browserHistory);
const createStoreWithMiddleware = applyMiddleware(reduxRouterMiddleware)(createStore);

View File

@@ -14,7 +14,6 @@
],
"paths": {
"history": ["history/v2"],
"react-router": ["react-router/v2"],
"react-router-redux": ["react-router-redux/v3"]
},
"types": [],