chore: remove connected-react-router (#5096)
This commit is contained in:
committed by
GitHub
parent
a25fa6d66f
commit
4703406e4f
@ -29,7 +29,6 @@
|
||||
"ajv": "^7.0.0",
|
||||
"ajv-errors": "^2.0.0",
|
||||
"ajv-keywords": "^4.0.0",
|
||||
"connected-react-router": "^6.8.0",
|
||||
"copy-text-to-clipboard": "^3.0.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"diacritics": "^1.3.0",
|
||||
|
9
packages/netlify-cms-core/src/bootstrap.js
vendored
9
packages/netlify-cms-core/src/bootstrap.js
vendored
@ -1,10 +1,9 @@
|
||||
import React from 'react';
|
||||
import { render } from 'react-dom';
|
||||
import { Provider, connect } from 'react-redux';
|
||||
import { Route } from 'react-router-dom';
|
||||
import { ConnectedRouter } from 'connected-react-router';
|
||||
import history from 'Routing/history';
|
||||
import { Route, Router } from 'react-router-dom';
|
||||
import store from 'ReduxStore';
|
||||
import history from 'Routing/history';
|
||||
import { loadConfig } from 'Actions/config';
|
||||
import { authenticateUser } from 'Actions/auth';
|
||||
import { getPhrases } from 'Lib/phrases';
|
||||
@ -23,9 +22,9 @@ function TranslatedApp({ locale, config }) {
|
||||
return (
|
||||
<I18n locale={locale} messages={getPhrases(locale)}>
|
||||
<ErrorBoundary showBackup config={config}>
|
||||
<ConnectedRouter history={history}>
|
||||
<Router history={history}>
|
||||
<Route component={App} />
|
||||
</ConnectedRouter>
|
||||
</Router>
|
||||
</ErrorBoundary>
|
||||
</I18n>
|
||||
);
|
||||
|
@ -1,13 +1,11 @@
|
||||
import { combineReducers } from 'redux';
|
||||
import { connectRouter } from 'connected-react-router';
|
||||
import { reducer as notifReducer } from 'redux-notifications';
|
||||
import reducers from './index';
|
||||
|
||||
function createRootReducer(history) {
|
||||
function createRootReducer() {
|
||||
return combineReducers({
|
||||
...reducers,
|
||||
notifs: notifReducer,
|
||||
router: connectRouter(history),
|
||||
});
|
||||
}
|
||||
|
@ -1,22 +1,14 @@
|
||||
import { createStore, applyMiddleware, AnyAction } from 'redux';
|
||||
import { composeWithDevTools } from 'redux-devtools-extension';
|
||||
import thunkMiddleware, { ThunkMiddleware } from 'redux-thunk';
|
||||
import { routerMiddleware } from 'connected-react-router';
|
||||
import { waitUntilAction } from './middleware/waitUntilAction';
|
||||
import createRootReducer from '../reducers/combinedReducer';
|
||||
import history from '../routing/history';
|
||||
import { State } from '../types/redux';
|
||||
import { Reducer } from 'react';
|
||||
|
||||
const store = createStore<State | undefined, AnyAction, unknown, unknown>(
|
||||
(createRootReducer(history) as unknown) as Reducer<State | undefined, AnyAction>,
|
||||
composeWithDevTools(
|
||||
applyMiddleware(
|
||||
routerMiddleware(history),
|
||||
thunkMiddleware as ThunkMiddleware<State, AnyAction>,
|
||||
waitUntilAction,
|
||||
),
|
||||
),
|
||||
(createRootReducer() as unknown) as Reducer<State | undefined, AnyAction>,
|
||||
composeWithDevTools(applyMiddleware(thunkMiddleware as ThunkMiddleware<State>, waitUntilAction)),
|
||||
);
|
||||
|
||||
export default store;
|
||||
|
Reference in New Issue
Block a user