replace react-router-redux by connected-react-router
This commit is contained in:
parent
3031dc3861
commit
5059166cbd
@ -1,6 +1,6 @@
|
||||
import React from 'react'
|
||||
import { Provider } from 'react-redux'
|
||||
import { ConnectedRouter } from 'react-router-redux'
|
||||
import { ConnectedRouter } from 'connected-react-router'
|
||||
|
||||
export default function Root({ store, history, children }) {
|
||||
return (
|
||||
|
@ -2,14 +2,14 @@
|
||||
import { createBrowserHistory } from 'history'
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { routerMiddleware } from 'react-router-redux'
|
||||
import { routerMiddleware } from 'connected-react-router'
|
||||
import { applyMiddleware, createStore, compose } from 'redux'
|
||||
import thunk from 'redux-thunk'
|
||||
|
||||
import App from './components/App'
|
||||
import Root from './components/Root'
|
||||
import registerServiceWorker from './registerServiceWorker'
|
||||
import reducers from './reducers'
|
||||
import createRootReducer from './reducers'
|
||||
import { loadProfile } from './actions/user'
|
||||
|
||||
export const history = createBrowserHistory()
|
||||
@ -17,7 +17,7 @@ export const history = createBrowserHistory()
|
||||
export const rootNode = document.getElementById('root')
|
||||
|
||||
export const store = createStore(
|
||||
reducers,
|
||||
createRootReducer(history),
|
||||
window.__STATE__, // Server state
|
||||
(window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose)(
|
||||
applyMiddleware(routerMiddleware(history), thunk)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { routerReducer } from 'react-router-redux'
|
||||
import { connectRouter } from 'connected-react-router'
|
||||
import { combineReducers } from 'redux'
|
||||
|
||||
import initial from './initial'
|
||||
@ -123,7 +123,7 @@ const user = (state = initial.user, action) => {
|
||||
const statistics = (state = initial.statistics, action) =>
|
||||
handleDataAndError(state, 'statistics', action)
|
||||
|
||||
const reducers = combineReducers({
|
||||
export default (history) => combineReducers({
|
||||
activities,
|
||||
calendarActivities,
|
||||
chartData,
|
||||
@ -132,10 +132,8 @@ const reducers = combineReducers({
|
||||
message,
|
||||
messages,
|
||||
records,
|
||||
router: routerReducer,
|
||||
router: connectRouter(history),
|
||||
sports,
|
||||
statistics,
|
||||
user,
|
||||
})
|
||||
|
||||
export default reducers
|
||||
|
@ -4,7 +4,9 @@
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@mapbox/togeojson": "^0.16.0",
|
||||
"add": "^2.0.6",
|
||||
"chalk": "2.4.1",
|
||||
"connected-react-router": "^5.0.1",
|
||||
"date-fns": "^1.29.0",
|
||||
"history": "^4.7.2",
|
||||
"leaflet": "^1.3.4",
|
||||
@ -16,7 +18,6 @@
|
||||
"react-leaflet": "^2.1.2",
|
||||
"react-redux": "^5.1.1",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"react-router-redux": "^5.0.0-alpha.9",
|
||||
"react-scripts": "2.1.1",
|
||||
"react-timezone": "^2.1.0",
|
||||
"recharts": "^1.4.1",
|
||||
|
34
yarn.lock
34
yarn.lock
@ -1105,6 +1105,11 @@ acorn@^6.0.1, acorn@^6.0.2:
|
||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.4.tgz#77377e7353b72ec5104550aa2d2097a2fd40b754"
|
||||
integrity sha512-VY4i5EKSKkofY2I+6QLTbTTN/UvEQPCo6eiwzzSaSWfpaDhOmStMCMod6wmuPciNq+XS0faCglFu2lHZpdHUtg==
|
||||
|
||||
add@^2.0.6:
|
||||
version "2.0.6"
|
||||
resolved "https://registry.yarnpkg.com/add/-/add-2.0.6.tgz#248f0a9f6e5a528ef2295dbeec30532130ae2235"
|
||||
integrity sha1-JI8Kn25aUo7yKV2+7DBTITCuIjU=
|
||||
|
||||
address@1.0.3, address@^1.0.1:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/address/-/address-1.0.3.tgz#b5f50631f8d6cec8bd20c963963afb55e06cbce9"
|
||||
@ -3061,6 +3066,14 @@ connected-domain@^1.0.0:
|
||||
resolved "https://registry.yarnpkg.com/connected-domain/-/connected-domain-1.0.0.tgz#bfe77238c74be453a79f0cb6058deeb4f2358e93"
|
||||
integrity sha1-v+dyOMdL5FOnnwy2BY3utPI1jpM=
|
||||
|
||||
connected-react-router@^5.0.1:
|
||||
version "5.0.1"
|
||||
resolved "https://registry.yarnpkg.com/connected-react-router/-/connected-react-router-5.0.1.tgz#8379854fad7e027b1e27652c00ad534f8ad244b3"
|
||||
integrity sha512-0QwWYPRGZQ7f284lmqc5kwC4T3iW3zrAH3zzi6uUMzTOxbA+mn38tAgMOoVo9m3pbskvONFtXiajgVkCElE9EQ==
|
||||
dependencies:
|
||||
immutable "^3.8.1"
|
||||
seamless-immutable "^7.1.3"
|
||||
|
||||
console-browserify@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
|
||||
@ -5478,6 +5491,11 @@ immer@1.7.2:
|
||||
resolved "https://registry.yarnpkg.com/immer/-/immer-1.7.2.tgz#a51e9723c50b27e132f6566facbec1c85fc69547"
|
||||
integrity sha512-4Urocwu9+XLDJw4Tc6ZCg7APVjjLInCFvO4TwGsAYV5zT6YYSor14dsZR0+0tHlDIN92cFUOq+i7fC00G5vTxA==
|
||||
|
||||
immutable@^3.8.1:
|
||||
version "3.8.2"
|
||||
resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
|
||||
integrity sha1-wkOZUUVbs5kT2vKBN28VMOEErfM=
|
||||
|
||||
import-cwd@^2.0.0:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9"
|
||||
@ -9032,16 +9050,7 @@ react-router-dom@^4.3.1:
|
||||
react-router "^4.3.1"
|
||||
warning "^4.0.1"
|
||||
|
||||
react-router-redux@^5.0.0-alpha.9:
|
||||
version "5.0.0-alpha.9"
|
||||
resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-5.0.0-alpha.9.tgz#825431516e0e6f1fd93b8807f6bd595e23ec3d10"
|
||||
integrity sha512-euSgNIANnRXr4GydIuwA7RZCefrLQzIw5WdXspS8NPYbV+FxrKSS9MKG7U9vb6vsKHONnA4VxrVNWfnMUnUQAw==
|
||||
dependencies:
|
||||
history "^4.7.2"
|
||||
prop-types "^15.6.0"
|
||||
react-router "^4.2.0"
|
||||
|
||||
react-router@^4.2.0, react-router@^4.3.1:
|
||||
react-router@^4.3.1:
|
||||
version "4.3.1"
|
||||
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e"
|
||||
integrity sha512-yrvL8AogDh2X42Dt9iknk4wF4V8bWREPirFfS9gLU1huk6qK41sg7Z/1S81jjTrGHxa3B8R3J6xIkDAA6CVarg==
|
||||
@ -9760,6 +9769,11 @@ schema-utils@^1.0.0:
|
||||
ajv-errors "^1.0.0"
|
||||
ajv-keywords "^3.1.0"
|
||||
|
||||
seamless-immutable@^7.1.3:
|
||||
version "7.1.4"
|
||||
resolved "https://registry.yarnpkg.com/seamless-immutable/-/seamless-immutable-7.1.4.tgz#6e9536def083ddc4dea0207d722e0e80d0f372f8"
|
||||
integrity sha512-XiUO1QP4ki4E2PHegiGAlu6r82o5A+6tRh7IkGGTVg/h+UoeX4nFBeCGPOhb4CYjvkqsfm/TUtvOMYC1xmV30A==
|
||||
|
||||
select-hose@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca"
|
||||
|
Loading…
Reference in New Issue
Block a user