-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
hashbang support!? #601
Comments
It is definitely supported (all the examples seem to run with hashbang mode). From the docs is seems like: //push state mode
Router.run(routes, Router.HistoryLocation, function (Handler) {
React.render(<Handler/>, el);
});
//hashbang mode
Router.run(routes, function (Handler) {
React.render(<Handler/>, el);
}); |
@ryanzec When you make the reference to hashbang, are you referencing #! or #? The app I'm building as to support the Running the example provided in this repo we can observe that only the # is used, not the #!. // hash mode
Router.run(routes, function (Handler) {
React.render(<Handler/>, el);
});
// still hash mode
Router.run(routes, Router.HashLocation, function (Handler) {
React.render(<Handler/>, el);
}); |
Ah, I misunderstand, I was talking about just the #, not #!. |
I have submitted a pull request #602 that enables the #! method. Altho, there are no tests for it so it's mostly just a way to kickstart the idea. I will use my fork in our project, so if I run into issues I will fix and resubmit a pull request. |
Am I the only one seeing that hashbang as bad practice? I never needed it. |
Depends on browser I think. I am in a lucky position where I only need to support IE 10+ (not many people are in that position). I am not sure at was IE version you need to use hashbangs. |
It's a trick for the google crawler, nothing to do with browsers. I'd definitely go with server rendering, but i understand it's not the easiest way... |
Thankfully hashbang is no longer in widespread use. Even Google don't use it anymore on their domains. As @gpbl pointed out, they were only ever needed for the Google page crawler, not for browsers. Old versions of IE will work fine using |
If definitely needed, you can use following stackoverflow answer http://stackoverflow.com/questions/25086832/how-to-stop-in-browser-with-react-router/32122395#32122395 @gpbl : one example where i needed it
|
Agreed with @Feawel, totally needed. |
If you want shareability and crawl-ability, you're going to need some sort of server-side support anyway, no? Facebook isn't going to request with the hash. I'm not 100% opposed to adding this as a feature, maybe, but it seems like you're doing something that's quite contrary to modern best practices if you're trying to work that way. |
+1 on hashbang support. Like @Feawel, I simply need the feature for legacy support as I'm working on a new front-end on top of a legacy API and I'm bound to S3. I understand that the better solution is to use server-side rendering etc, but that simply isn't an option in this project. It's an unfortunate reality, but not all companies can be as future-ready as facebook ;) TL;DR: Because of the lack of hashbang support I can't use react-router, please fix! |
If you want this feature, make an appropriate PR to history. |
PR #602 has already been rejected with this feature |
#602 had no tests and also isn't merge-able any more. |
Small update for those who run into this issue on Amazon S3; the problem can be circumvented by specifying the main More details are available in this blog post. |
Did I miss something or there are no support for hashbang?
If it's not supported, is it planed to add the ability to chose to use a hashbang or a simple hash?
Thanks
The text was updated successfully, but these errors were encountered: