From bee5105c4dfeba76339422fcc45cec70f5fdc2b5 Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Mon, 30 Jan 2017 12:22:25 +0900 Subject: [PATCH] Remove react-router from tests and create browserHistory manually --- react-router-redux/react-router-redux-tests.ts | 3 ++- react-router-redux/v3/react-router-redux-tests.ts | 3 ++- react-router-redux/v3/tsconfig.json | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/react-router-redux/react-router-redux-tests.ts b/react-router-redux/react-router-redux-tests.ts index 87b99b2a69..bcf4eaaed1 100644 --- a/react-router-redux/react-router-redux-tests.ts +++ b/react-router-redux/react-router-redux-tests.ts @@ -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, diff --git a/react-router-redux/v3/react-router-redux-tests.ts b/react-router-redux/v3/react-router-redux-tests.ts index c719fb8459..90d68841ff 100644 --- a/react-router-redux/v3/react-router-redux-tests.ts +++ b/react-router-redux/v3/react-router-redux-tests.ts @@ -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); diff --git a/react-router-redux/v3/tsconfig.json b/react-router-redux/v3/tsconfig.json index 240e09923e..ee406e1759 100644 --- a/react-router-redux/v3/tsconfig.json +++ b/react-router-redux/v3/tsconfig.json @@ -14,7 +14,6 @@ ], "paths": { "history": ["history/v2"], - "react-router": ["react-router/v2"], "react-router-redux": ["react-router-redux/v3"] }, "types": [],