Closed tomatau closed 8 years ago
Thanks, @tomatau. Seeing the same in my app when I add a console.log
to onUpdate
. I'll take a look and see what I find.
I've got a failing test, looking for a solution that doesn't break other stuff.
@tomatau I found a solution and created a PR. I'll have to think a bit more on it as I'm not entirely sure about the implementation, but hopefully we should have a fix soon.
I'm closing this as we're tracking it in #109
Thanks for addressing this so quickly
I re-opened it. #109 already solves a double update, but there might be another problem here. Will look at it tomorrow.
@tomatau Maybe you could try out #129 and see if it helps with the double onUpdate
?
When navigating with pushPath, it dispatches @@router/UPDATE_PATH
twice, once with state: false, replace: false
and the second with state: null, replace: true
.
When navigating with a normal Link (history), the @@router/UPDATE_PATH
is only dispatched once, but the Router.onUpdate is still double invoked.
When redux-simple-router is setup and a path is updated through a Link or IndexLink from react router, the Router.onUpdate method is double invoked.
If pushPath or updatePath is used, the onUpdate behaves normally.
Here's a branch where it's happening for me onUpdate handler: https://github.com/tomatau/breko-hub/blob/versionUpdates/src/app/entry.js#L33
integration: https://github.com/tomatau/breko-hub/blob/versionUpdates/src/app/state/store.js#L23
navigation: https://github.com/tomatau/breko-hub/blob/versionUpdates/src/app/components/containers/HeadNavigation.js#L23