redux-first-routing icon indicating copy to clipboard operation
redux-first-routing copied to clipboard

push pushes the pathname to router and path changes but does not trigger re-render.

Open PatrykSitko opened this issue 3 years ago • 2 comments

Hi, I've been using your project for some time. It always worked fine. I've been away from react for a time and have lately started a project. I've updated all packages to the latest versions. The base project template did not change. After the package updates and a minor change from Router to BrowserRouter and From Switch to Paths, everything was running. Now I'm working on a component where I try to implement push. It works as expected, The store updates and the pathname changes with one minor difference. There's no component change, as I've implemented a updateTick, I don't have to force update as react is constantly updating. If I add to createBrowserHistory({forceReload:true}) everything starts working again. But as we know, reloads are not really permitted in single page apps. What is going wrong with the package, what do I have to implement to make the BrowserRouter notice that the pathname has changed and another component should be loaded? Thanks [The mentioned template: https://github.com/PatrykSitko/react-template]

PatrykSitko avatar Aug 23 '22 19:08 PatrykSitko

Now whenever the navigate function is used. Using push creates a duplicate entry inside of the window.history. Could I demand you a "ghost"-push. One that modifies redux but doesn't touch the window.location.pathname.

PatrykSitko avatar Aug 26 '22 08:08 PatrykSitko

For the moment, I've created my own routerMiddleware where history.push is disabled.

PatrykSitko avatar Aug 26 '22 08:08 PatrykSitko