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

Commit 3ae8110

Browse files
committed
Compare location changes against initialState.
Also, replace the location, rather than transitionTo it. The location in the initialState is no longer undefined, so we should compare if we're going back to that state. Because the initial action is normally a POP, we can't transition to that kind of action and instead need to replace our location. Fixes #164 Fixes #252
1 parent c3dc895 commit 3ae8110

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export function syncHistory(history) {
8383
// If we're resetting to the beginning, use the saved initial value. We
8484
// need to dispatch a new action at this point to populate the store
8585
// appropriately.
86-
if (!location) {
87-
history.transitionTo(initialLocation)
86+
if (location.key === initialLocation.key) {
87+
history.replace(initialLocation)
8888
return
8989
}
9090

0 commit comments

Comments
 (0)