Skip to content

Commit f8c56c9

Browse files
authored
Merge pull request ashok-khanna#2 from testerez/patch-1
Reuse `navigate` function.
2 parents 8fb29b0 + 9b11166 commit f8c56c9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Router.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,7 @@ export function Link ({ className, href, children }) {
101101
// prevent full page reload
102102
event.preventDefault();
103103

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);
104+
navigate(href);
110105
};
111106

112107
return (

0 commit comments

Comments
 (0)