Skip to content
This repository was archived by the owner on Oct 26, 2018. It is now read-only.

Initialize path with basename #146

Closed
neverfox opened this issue Dec 31, 2015 · 2 comments
Closed

Initialize path with basename #146

neverfox opened this issue Dec 31, 2015 · 2 comments

Comments

@neverfox
Copy link

When using useBasename, the path in the address bar (and state) should be initialized with the basename path when the app inits. This is the behavior you got with redux-router and is also the behavior you get from Ember's router (when using their router's rootURL). This makes the association between history and state consistent from the very beginning. As it is now, the basename is only introduced into the browser history and state when the path is changed, e.g. with pushPath. (I'm using history 1.17.0 and redux-simple-router 1.0.2.

@neverfox
Copy link
Author

neverfox commented Jan 1, 2016

Unfortunately, because of this, and the fact that the configured basename isn't available to redux-simple-router (because it's just closed over), this would require a change to rackt/history.

@taion
Copy link
Member

taion commented Jan 1, 2016

This is not the correct behavior from the POV of history/router, per remix-run/history#197. If the URL doesn't have the basename for some reason, it's not correct for the history to lie to you about what the basename of the current location is. You'll have to handle this redirect in userspace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants