-
Notifications
You must be signed in to change notification settings - Fork 593
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
Location state absent in LOCATION_CHANGE action #301
Comments
@supasate any update on this? It looks like the fix is pretty simple and I'm not sure why the issue is stale for so long |
Update? @fzaninotto has a solution in his PR which looks pretty intuitive. Right now, otherwise, requiring a bit of over-engineering to use route params within reducers or actions which isn't great (especially for cross-OS/react native systems). This is about 65% of the reason I just added |
Please review this. |
* Include location state and key in LOCATION_CHANGE payload Closes #301 * Remove location.key
React-router uses history's
location
object:(see https://github.com/ReactTraining/history#listening)
connected-react-router only passes
pathname
,search
andhash
fields to theLOCATION_CHANGE
action, and ignores thestate
andkey
fields.connected-react-router/src/ConnectedRouter.js
Lines 28 to 49 in 37e90d7
As a consequence, a link using location state like this:
Is translated by connected-react-router as the following action:
Notice the missing
state
key in thelocation
.As a consequence, reducers can't use the value passed in the
state
.Note that this was properly handled by
react-router-redux
.The text was updated successfully, but these errors were encountered: