react-router-redux icon indicating copy to clipboard operation
react-router-redux copied to clipboard

<base href="..."> ignored

Open PixnBits opened this issue 11 years ago • 5 comments

It appears that the initial state looks at only the current location without regard to a <base> tag being present (value available in document.baseURI).

Is this correct? Is this a use case (webapp at a level other than domain-level) desired to be solved by this package?

PixnBits avatar Nov 30 '15 16:11 PixnBits

I've never used the <base> tag, so not sure what we need to think about there, but could you test your code with master? Quite a few changes to how we handle the location, might be it helps.

If you're using npm, you can test master with:

"redux-simple-router": "https://github.com/jlongster/redux-simple-router.git#master"

kimjoar avatar Dec 03 '15 14:12 kimjoar

I think it's bad that we look directly at window.location, because we're supposed to just be looking at the history object. The problem is the API is a little awkward right now: there is no getCurrentLocation for various reasons, but the listen function is called immediately the first time it registers with the initial location.

I've mentioned this in another thread (don't have the link) but we should probably just reset the initial state with the first location we're given. Then we're just inheriting whatever behavior history has. Whether or not it supports base is an issue that can be talked about there.

jlongster avatar Dec 03 '15 15:12 jlongster

I think this may be it: https://github.com/jlongster/redux-simple-router/pull/38#issuecomment-159656061

ellbee avatar Dec 03 '15 16:12 ellbee

@jlongster Master no longer relies on window.location, only on the location received from history.listen. Might help, but never needed <base>, so not sure.

kimjoar avatar Dec 03 '15 23:12 kimjoar

Fantastic, looks to be working! I'm looking forward to the next release :+1:

PixnBits avatar Dec 05 '15 01:12 PixnBits