-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Router without address bar #789
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
Likewise pondering this situation. I suspect I'll have to create a custom Location object. But I'd really prefer to have such a thing officially supported. |
In web applications, the address bar is the only piece of state we have to determine what we're going to show on the page. That's why URLs are absolutely essential to the design and function of react-router. If you're switching some piece of UI but not reflecting the change in the URL, you still need to store that state somewhere, probably either in memory (in We don't support this in the router right now, but I think #828 may be related. Being able to store/retrieve application state from somewhere other than the URL may be something we want to support in the future. |
As much as I can, I'd like my router state reflected in the URL. However, in my case, I'm hoping for state to be retained internally somewhere. Like @kirill-konshin, I'm building a small piece of a larger interface. Until react-router controls all parts of the UI, not just a portion, I'd prefer to retain the router state elsewhere, where it doesn't assume it owns the URL. As is, it could potentially cause conflicts in other parts of the non-React/react-router app. Looking forward to if #828 could solve this. Thanks. |
It seems that TestLocation works just fine. But I can't use it in my other project, that is not CommonJS based... So I've created a small PR where TestLocation is added to list of exports. |
we now have |
Is there a way to prevent Router from modifications of browser's address bar?
For example, angular-ui-router can run in an entirely isolated mode, so that you still can use states and transitions between them, but address bar stays untouched. Works well for widget-like components, that are installed somewhere in the page and should not modify neither path nor hash.
As far as I can see from docs and code, there are options: HashLocation, HistoryLocation, RefreshLocation. There is also TestLocation -- will it fit in this above mentioned use-case? Unfortunately it's not included in the build...
The text was updated successfully, but these errors were encountered: