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

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

Open
PatrykSitko opened this issue Aug 23, 2022 · 2 comments

Comments

@PatrykSitko
Copy link

PatrykSitko commented Aug 23, 2022

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
Copy link
Author

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
Copy link
Author

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

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

1 participant