mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-16 12:09:24 +08:00
Remove react-router from tests and create browserHistory manually
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
],
|
||||
"paths": {
|
||||
"history": ["history/v2"],
|
||||
"react-router": ["react-router/v2"],
|
||||
"react-router-redux": ["react-router-redux/v3"]
|
||||
},
|
||||
"types": [],
|
||||
|
||||
Reference in New Issue
Block a user