Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work properly with "history" v5.0.0 #487

Open
simpleman383 opened this issue Mar 10, 2021 · 2 comments
Open

Doesn't work properly with "history" v5.0.0 #487

simpleman383 opened this issue Mar 10, 2021 · 2 comments

Comments

@simpleman383
Copy link

simpleman383 commented Mar 10, 2021

In case of bundling the latest version of "connected-react-router" with the "history" package at version 5.0.0, the router doesn't seem to react to the changes of the history object: redux actions (dispatching with push("/some-route")) and clicks on <Link /> component lead to the change of browser's URL but do not re-render the affected component.

Such behaviour can be observed even in the example projects provided in the repository (e.g. "basic" project https://github.com/supasate/connected-react-router/tree/master/examples/basic).

Example

  1. Modified dependency list of the "basic" project (https://github.com/supasate/connected-react-router/tree/master/examples/basic)
    with history v5.0.0
{
  "name": "connected-react-router-example-basic",
  "version": "1.0.0",
  "description": "A basic example for Connected React Router",
  "main": "src/index.js",
  "scripts": {
    "dev": "node server.js",
    "build": "webpack --mode production"
  },
  "author": "Supasate Choochaisri",
  "license": "MIT",
  "devDependencies": {
    "@babel/core": "^7.1.2",
    "@babel/preset-env": "^7.1.0",
    "@babel/preset-react": "^7.0.0",
    "babel-cli": "^6.26.0",
    "babel-loader": "^8.0.4",
    "express": "^4.16.4",
    "react-hot-loader": "^4.3.12",
    "webpack": "^4.24.0",
    "webpack-cli": "^3.1.2",
    "webpack-dev-middleware": "^3.4.0",
    "webpack-hot-middleware": "^2.24.3"
  },
  "dependencies": {
    "connected-react-router": "^6.0.0",
    "history": "^5.0.0",
    "prop-types": "^15.6.2",
    "react": "^16.6.0",
    "react-dom": "^16.6.0",
    "react-redux": "^6.0.0",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "redux": "^4.0.1"
  }
}
  1. Application behaviour

image

@alexplumb
Copy link

This is an upstream problem - React Router doesn't support history v5 yet. remix-run/history#804

@lagunovsky
Copy link

If you are starting a new project, you can try lagunovsky/redux-react-router based on React Router v6 and History v5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants