mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 01:23:53 -07:00
New: Replace 'react-router-redux' with 'connected-react-router'
This commit is contained in:
parent
df65b5b290
commit
f43c1e749f
12 changed files with 59 additions and 48 deletions
|
@ -10,7 +10,7 @@ import AddNewArtist from './AddNewArtist';
|
|||
function createMapStateToProps() {
|
||||
return createSelector(
|
||||
(state) => state.addArtist,
|
||||
(state) => state.routing.location,
|
||||
(state) => state.router.location,
|
||||
(addArtist, location) => {
|
||||
const { params } = parseUrl(location.search);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { push } from 'react-router-redux';
|
||||
import { push } from 'connected-react-router';
|
||||
import createSystemStatusSelector from 'Store/Selectors/createSystemStatusSelector';
|
||||
import { fetchRootFolders, addRootFolder } from 'Store/Actions/rootFolderActions';
|
||||
import ImportArtistSelectFolder from './ImportArtistSelectFolder';
|
||||
|
|
|
@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { push } from 'react-router-redux';
|
||||
import { push } from 'connected-react-router';
|
||||
import NotFound from 'Components/NotFound';
|
||||
import { fetchAlbums, clearAlbums } from 'Store/Actions/albumActions';
|
||||
import LoadingIndicator from 'Components/Loading/LoadingIndicator';
|
||||
|
|
|
@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
|
|||
import React from 'react';
|
||||
import DocumentTitle from 'react-document-title';
|
||||
import { Provider } from 'react-redux';
|
||||
import { ConnectedRouter } from 'react-router-redux';
|
||||
import { ConnectedRouter } from 'connected-react-router';
|
||||
import PageConnector from 'Components/Page/PageConnector';
|
||||
import AppRoutes from './AppRoutes';
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|||
import React, { Component } from 'react';
|
||||
import { connect } from 'react-redux';
|
||||
import { createSelector } from 'reselect';
|
||||
import { push } from 'react-router-redux';
|
||||
import { push } from 'connected-react-router';
|
||||
import createAllArtistSelector from 'Store/Selectors/createAllArtistSelector';
|
||||
import NotFound from 'Components/NotFound';
|
||||
import ArtistDetailsConnector from './ArtistDetailsConnector';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { push } from 'react-router-redux';
|
||||
import { push } from 'connected-react-router';
|
||||
import { createSelector } from 'reselect';
|
||||
import jdu from 'jdu';
|
||||
import createAllArtistSelector from 'Store/Selectors/createAllArtistSelector';
|
||||
|
|
|
@ -89,4 +89,4 @@ QualityDefinitionsConnector.propTypes = {
|
|||
onChildStateChange: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default connect(createMapStateToProps, mapDispatchToProps, null, { withRef: true })(QualityDefinitionsConnector);
|
||||
export default connect(createMapStateToProps, mapDispatchToProps, null)(QualityDefinitionsConnector);
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
import { combineReducers } from 'redux';
|
||||
import { enableBatching } from 'redux-batched-actions';
|
||||
import { routerReducer } from 'react-router-redux';
|
||||
import actions from 'Store/Actions';
|
||||
import { connectRouter } from 'connected-react-router';
|
||||
|
||||
const defaultState = {};
|
||||
|
||||
const reducers = {
|
||||
routing: routerReducer
|
||||
};
|
||||
const reducers = {};
|
||||
|
||||
actions.forEach((action) => {
|
||||
const section = action.section;
|
||||
|
@ -17,4 +14,10 @@ actions.forEach((action) => {
|
|||
});
|
||||
|
||||
export { defaultState };
|
||||
export default enableBatching(combineReducers(reducers));
|
||||
|
||||
export default function(history) {
|
||||
return enableBatching(combineReducers({
|
||||
...reducers,
|
||||
router: connectRouter(history)
|
||||
}));
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
import { applyMiddleware, compose } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
import { routerMiddleware } from 'react-router-redux';
|
||||
import { routerMiddleware } from 'connected-react-router';
|
||||
import createSentryMiddleware from './createSentryMiddleware';
|
||||
import createPersistState from './createPersistState';
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { createStore } from 'redux';
|
||||
import reducers, { defaultState } from 'Store/Actions/reducers';
|
||||
import createReducers, { defaultState } from 'Store/Actions/createReducers';
|
||||
import middlewares from 'Store/Middleware/middlewares';
|
||||
|
||||
function createAppStore(history) {
|
||||
const appStore = createStore(
|
||||
reducers,
|
||||
createReducers(history),
|
||||
defaultState,
|
||||
middlewares(history)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue