diff --git a/package.json b/package.json index fad2d96..b878282 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "babel-polyfill": "^6.26.0", "bootstrap": "^4.3.1", "classnames": "^2.2.6", - "connected-react-router": "^4.2.3", + "connected-react-router": "^6.9.3", "cross-env": "^7.0.3", "dotenv": "^8.2.0", "eslint": "^8", diff --git a/src/reducers/index.ts b/src/reducers/index.ts index 44e5dec..0cb9b69 100644 --- a/src/reducers/index.ts +++ b/src/reducers/index.ts @@ -2,8 +2,10 @@ import { combineReducers } from "redux"; import { firebaseReducer } from "react-redux-firebase"; import { firestoreReducer } from "redux-firestore"; import itemReducer from "./item"; +import { connectRouter } from 'connected-react-router' -export default combineReducers({ +export default (history) => combineReducers({ + router: connectRouter(history), firebase: firebaseReducer, firestore: firestoreReducer, item: itemReducer, diff --git a/src/store.ts b/src/store.ts index 9b67b9e..79f28d5 100644 --- a/src/store.ts +++ b/src/store.ts @@ -1,5 +1,5 @@ import { createStore, applyMiddleware, compose } from "redux"; -import { routerMiddleware, connectRouter } from "connected-react-router"; +import { routerMiddleware } from "connected-react-router"; import { createBrowserHistory } from "history"; import { createLogger } from "redux-logger"; import thunkMiddleware from "redux-thunk"; @@ -7,7 +7,7 @@ import freeze from "redux-freeze"; import { reactReduxFirebase } from "react-redux-firebase"; import { reduxFirestore } from "redux-firestore"; import firebase from "firebase/app"; -import rootReducer from "./reducers/index"; +import createRootReducer from "./reducers"; import "firebase/auth"; import "firebase/database"; import "firebase/firestore"; @@ -47,7 +47,7 @@ if (process.env.NODE_ENV !== "production") { const middleware = applyMiddleware(...middlewares); const store = createStoreWithFirebase( - connectRouter(history)(rootReducer), + createRootReducer(history), middleware, ); diff --git a/yarn.lock b/yarn.lock index c105ac4..f26d7ec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4662,13 +4662,15 @@ connect-history-api-fallback@^2.0.0: resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== -connected-react-router@^4.2.3: - version "4.5.0" - resolved "https://registry.yarnpkg.com/connected-react-router/-/connected-react-router-4.5.0.tgz#b6f021cc284a244fbee70e16e5ff0f2a4613e3d3" - integrity sha512-SBBmAZrtmw4y7Rkl2PCct8lN/DuCftl7QSAFLgFyjjuYkeJKAzAvQjzNNNE4R3j2+6a4TUiv8qselxQ4+6H5eA== +connected-react-router@^6.9.3: + version "6.9.3" + resolved "https://registry.yarnpkg.com/connected-react-router/-/connected-react-router-6.9.3.tgz#72300aca9f9d6f38e1f4a2901572faa02adec972" + integrity sha512-4ThxysOiv/R2Dc4Cke1eJwjKwH1Y51VDwlOrOfs1LjpdYOVvCNjNkZDayo7+sx42EeGJPQUNchWkjAIJdXGIOQ== dependencies: - immutable "^3.8.1" - redux-seamless-immutable "^0.4.0" + lodash.isequalwith "^4.4.0" + prop-types "^15.7.2" + optionalDependencies: + immutable "^3.8.1 || ^4.0.0" seamless-immutable "^7.1.3" console-browserify@^1.1.0: @@ -7370,10 +7372,10 @@ immutability-helper@^3.0.1: resolved "https://registry.yarnpkg.com/immutability-helper/-/immutability-helper-3.1.1.tgz#2b86b2286ed3b1241c9e23b7b21e0444f52f77b7" integrity sha512-Q0QaXjPjwIju/28TsugCHNEASwoCcJSyJV3uO1sOIQGI0jKgm9f41Lvz0DZj3n46cNCyAZTsEYoY4C2bVRUzyQ== -immutable@^3.8.1: - version "3.8.2" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3" - integrity sha512-15gZoQ38eYjEjxkorfbcgBKBL6R7T459OuK+CpcWt7O3KF4uPCx2tD0uFETlUDIyo+1789crbMhTvQBSR5yBMg== +"immutable@^3.8.1 || ^4.0.0": + version "4.3.7" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.7.tgz#c70145fc90d89fb02021e65c84eb0226e4e5a381" + integrity sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw== import-fresh@^3.1.0, import-fresh@^3.2.1: version "3.3.0" @@ -8955,6 +8957,11 @@ lodash.debounce@^4.0.0, lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== +lodash.isequalwith@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.isequalwith/-/lodash.isequalwith-4.4.0.tgz#266726ddd528f854f21f4ea98a065606e0fbc6b0" + integrity sha512-dcZON0IalGBpRmJBmMkaoV7d3I80R2O+FrzsZyHdNSFrANq/cgDqKQNmAHE8UEj4+QYWwwhkQOVdLHiAopzlsQ== + lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -11302,11 +11309,6 @@ react-router-dom@^4.2.2: react-router "^4.3.1" warning "^4.0.1" -react-router-redux@^4.0.0: - version "4.0.8" - resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-4.0.8.tgz#227403596b5151e182377dab835b5d45f0f8054e" - integrity sha512-lzlK+S6jZnn17BZbzBe6F8ok3YAhGAUlyWgRu3cz5mT199gKxfem5lNu3qcgzRiVhNEOFVG0/pdT+1t4aWhoQw== - react-router@^4.2.0, react-router@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e" @@ -11576,14 +11578,6 @@ redux-logger@^3.0.6: dependencies: deep-diff "^0.3.5" -redux-seamless-immutable@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/redux-seamless-immutable/-/redux-seamless-immutable-0.4.0.tgz#b50f8680ecc5ef04021551267f78fa1ffd3cf985" - integrity sha512-/oS3fhrize9D3RSHemgJxVllohybRrad5IjccotFy8Ni4IKAPTtX1mqszpiCIl12+7v0dNqBpq6ES6R236AliQ== - dependencies: - react-router-redux "^4.0.0" - seamless-immutable "^7.1.2" - redux-thunk@^2.2.0: version "2.4.2" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.4.2.tgz#b9d05d11994b99f7a91ea223e8b04cf0afa5ef3b" @@ -12058,7 +12052,7 @@ scrollparent@^2.1.0: resolved "https://registry.yarnpkg.com/scrollparent/-/scrollparent-2.1.0.tgz#6cae915c953835886a6ba0d77fdc2bb1ed09076d" integrity sha512-bnnvJL28/Rtz/kz2+4wpBjHzWoEzXhVg/TE8BeVGJHUqE8THNIRnDxDWMktwM+qahvlRdvlLdsQfYe+cuqfZeA== -seamless-immutable@^7.1.2, seamless-immutable@^7.1.3: +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==