Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
if (manageScrollRestoration) {
scrollRestorer.start({ autoRestore: false });
}
const win = getWindow();
if (!win.location.hash && manageScrollRestoration) {
scrollRestorer.restoreScroll();
} else {
scrollToFragment();
}
routeTo._setRouteToHandler(this.routeTo);
win.addEventListener('popstate', (event) => {
event.preventDefault();
changePage(
{
pathname: win.location.pathname,
search: win.location.search,
hash: win.location.hash
},
this.setState.bind(this)
);
});
if (hijackLinks) {
linkHijacker.hijack(
{
skipFilter: (link) =>