Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Commit

Permalink
Always push path on initial route
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjoar committed Dec 12, 2015
1 parent 2ed7ad8 commit 2af7b28
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ function syncReduxAndRouter(history, store, selectRouterState = SELECT_STATE) {
// trigger an unnecessary `pushState` on load
lastRoute = initialState

const method = location.action === 'REPLACE' ? replacePath : pushPath;
store.dispatch(method(route.path, route.state, { avoidRouterUpdate: true }));
store.dispatch(pushPath(route.path, route.state, { avoidRouterUpdate: true }));
} else if(!locationsAreEqual(getRouterState(), route)) {
// The above check avoids dispatching an action if the store is
// already up-to-date
Expand Down

0 comments on commit 2af7b28

Please sign in to comment.