-
Notifications
You must be signed in to change notification settings - Fork 140
Using hash history instead of browser history? #114
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
Comments
It's intended. Since ur bringing it up I'm not sure if it's correct :). If that's a problem I think the best solution is to add a createHistory option which takes a factory. That way people can use hash history or forks. But we have to actually call the factory internally now. |
Thanks for pointing this out. There is now a import createHashHistory from 'history/createHashHistory'
connectRoutes(routesMap, { createHistory: createHashHistory }) Otherwise, for anyone reading this, if you're not passing your own |
Also, just fyi, it's only currently on the |
@chanand out of curiosity why are you choosing to use memory history? Are there any reasons outside of fallbacks to use hash history? Do you dynamically choose hash history for certain browsers? What logic do you use to make that determination? It seems as far as SSR, it would pose some additional challenges. Basically in that case you have to determine the would-be path based on the hash and pass that to Also, the hash history doesn't work when pressing the back/next buttons in firefox without reloads. I'm trying to determine if some automatic fallback to hash history in some cases might be of use to us. I'm currently thinking of just falling back to memoryHistory. I'm not a fan of forced reloads. My current thinking is that there's more value in just keeping the app running smoothly than letting a small percentage of users have URLs to hang on to. But perhaps it makes sense to fallback to hash history instead of memory history in some cases. |
@faceyspacey I'm using the hash history because I'm deploying a single page app (with no SSR) while I have no control on the hosting server. |
We're using |
Is there any example or documentation on using hashHistory? My application doesn't have any use for SSR. It interacts with a Java-based server side application through REST APIs. The content on the client side is very dynamic resulting in thousands of unique URLs. I do not need to generate a new request for each behind a user login. hashHistory is a better fit than regular browserHistory for my use case. I'm trying to use the @latest npm version. |
On previous versions we were able to pass a hash history to the
connectRoutes
function, like:It seems like now, with history handled internally, there is no way to use hash history anymore, is that correct and intended?
The text was updated successfully, but these errors were encountered: