diff --git a/src/sync.js b/src/sync.js index 38832a8..d1f137f 100644 --- a/src/sync.js +++ b/src/sync.js @@ -10,7 +10,9 @@ export const syncHistoryWithStore = (history, store) => { }; const unsubscribeFromHistory = history.listen(handleLocationChange); - + if (history.getCurrentLocation) { + handleLocationChange(history.getCurrentLocation()); + } return { ...history, // User can subscribe to history changes