-
Notifications
You must be signed in to change notification settings - Fork 642
Conversation
The problem is that there's no way to get the "current location", so With your changes here, the app state will not have the correct route for the initial route. |
We can get around this by creating a different action type, I suppose, something like INIT_PATH. |
Ah, I see what you mean. That makes sense. I'm actually making some changing in this area but I'll go ahead and merge this. |
Don't navigate immediately on boot.
Thanks! |
I think this actually broke some tests. I need to integrate TravisCI on here. I'll look into it. |
Ok, so I need to back this out because it broke tests, most importantly these 2: https://github.com/jlongster/redux-simple-router/blob/master/test/createTests.js#L436 Please wait a day or two because I'm going to land some changes with this code, and it might fix your issue. |
No worries. Thanks. |
See #83 now. |
Had an issue in my app, in combination with
react-fetcher
, whereredux-simple-router
would create a history navigation on load, even though there's no reason to immediately navigate right on boot (the url is already in the URL bar).Was this behavior intentional? Changing this line fixed the issue for me and I no longer have a redundant
UPDATE_PATH
on boot and an additional fetch.If it helps, I'm pairing this with populating
state.routing.path
on the server side usingreq.url
, so the routing path is correctly pre-populated on boot.