Skip to content

Commit 33a13cc

Browse files
committed
Diff final URL before redrawing, to prevent unnecessary redraws
1 parent ab0a28d commit 33a13cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/std/router.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ export var WithRouter = ({prefix, initial: href}) => {
2727
var updateRoute = () => {
2828
if (href === window.location.href) return
2929
href = window.location.href
30-
redraw()
30+
var prevUrl = currentUrl
3131
updateRouteWithHref()
32+
if (currentUrl.href !== prevUrl.href) redraw()
3233
}
3334

3435
var set = (path, {replace, state} = {}) => {

0 commit comments

Comments
 (0)