Skip to content

Commit 7186fe8

Browse files
dstreetnkzawa
authored andcommitted
Only update history state if url differs. (vercel#172)
1 parent 77739f4 commit 7186fe8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/router.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ export default class Router {
108108
throw err
109109
}
110110

111-
window.history[method]({ route }, null, url)
111+
if (getURL() !== url) {
112+
window.history[method]({ route }, null, url)
113+
}
114+
112115
this.route = route
113116
this.set(url, { ...data, props })
114117
return true

0 commit comments

Comments
 (0)