-
Notifications
You must be signed in to change notification settings - Fork 114
Query object is not passed when using the back button #211
Comments
Is this not a duplicate of #165? We've been seeing this on v13.2.0, but haven't tried things out since v14 went out. IIRC, it was pretty obvious that this would be an issue, since the deserialized Just glancing at #197, it looks like this is the exact change that @tptee implemented. 👍 We'll have to upgrade and confirm that things are resolved. |
#197 didn't fix the bug. I may be wrong here, but the way the queue is working doesn't look correct. Glancing through the code, it looks like the usage of if (isNavigationAction(action)) {
return {
...state,
queue: state.queue && state.queue.concat([action.payload])
};
}
I've applied a simple fix to this, which I've confirmed working with my app with no problems so far: if (isNavigationAction(action) && action.payload && action.payload.pathname) {
return {
...state,
queue: state.queue && state.queue.concat([action.payload])
};
} I haven't gone through the entire codebase to provide a proper, well thought out fix and I can't get the Mocha tests to run on Windows so I'll leave the PR to someone else. |
Seems this repo's gotten inactive. I have hacked together a fork in the mean time for those who need it this issue fixed. You can find my fork here the two fixes: https://github.com/jahed/redux-little-router The commits that fixed it for me are: |
@tptee I think there are two distinct issues here. First, the issue that @jahed outlined where the queue is populated with invalid values since it queues for That issue occurs specifically when you dispatch I'm thinking this can all be resolved by:
Do those sound reasonable to you? |
Makes sense 👍 |
Fixed in |
If you:
/products?q=cool
)products/12345
)products/12345
->/products?q=cool
)In
1
theROUTER_LOCATION_CHANGED
action includes the query object in the payload; however, in3
the query object is not available in the payload (but you do have access to the search param).I have a small change to address this and will be opening a PR shortly.
The text was updated successfully, but these errors were encountered: