Skip to content

Commit 6cc9e28

Browse files
authored
Reuse navigate function.
1 parent 8fb29b0 commit 6cc9e28

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Router.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,7 @@ export function Link ({ className, href, children }) {
9898
return;
9999
}
100100

101-
// prevent full page reload
102-
event.preventDefault();
103-
104-
// update url
105-
window.history.pushState({}, "", href);
106-
107-
// communicate to Routes that URL has changed
108-
const navEvent = new PopStateEvent('popstate');
109-
window.dispatchEvent(navEvent);
101+
navigate(href);
110102
};
111103

112104
return (

0 commit comments

Comments
 (0)