-
Notifications
You must be signed in to change notification settings - Fork 30
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
Set URI fragment/hash #117
Comments
Hi @hkeide, this router was designed with the assumption of push state. May I know why you need to go for hash part? For your second question, the router only knows about the specified routes sent to it in the constructor. I think it should be ok to use the history API outside of the router. Let me know how this works out for you. |
Hi, I have a long feed page, and I want to be able to scroll to a specific location on the page using a link without having to reload the SPA |
If I am not mistaken, you should be able to render links on that page with associated hashes and they should jump to the right location. For example: |
Doesn't a raw a tag like that always cause a page reload? It seems I have to override routerStateToUrl() so that routerStore.goToState() will do the right thing in the onClick handler? I can't see a way to do this without forking the library. Please correct me if I'm wrong. I can create a PR for adding fragment capability if you're interested. |
@hkeide, I believe that is correct.
@nareshbhatia, it's somewhat discouraging that I need to basically rewrite that entire component in order to create hash-links. Is there no better solution? |
Hi @laustdeleuran, please feel free to submit a PR for this. |
@nareshbhatia I actually looked into forking the Effectively, it seems like I'd have to extend So, in other words, I'd have to submit a PR modifying the core functionality of this library, which I'm honestly down for, but I would love some more input on where this functionality should live. It feels clear to me that it should not live in the |
Hello, thanks for a great library, finally something sane and simple.
Can I set the hash part of a URL in a link? I've looked everywhere and I can't find it mentioned anywhere.
Also, is there a good way to navigate to a completely custom full URL without having the library build the href? For example I get a sent a full URL by the server and I want to navigate to it without knowing which route it goes to. Should I just use the browser history API directly for this use case?
The text was updated successfully, but these errors were encountered: