diff --git a/src/AppProgressBar.tsx b/src/AppProgressBar.tsx index b462e81..0496af5 100644 --- a/src/AppProgressBar.tsx +++ b/src/AppProgressBar.tsx @@ -150,12 +150,16 @@ export const Next13ProgressBar = React.memo( const mutationObserver = new MutationObserver(handleMutation); mutationObserver.observe(document, { childList: true, subtree: true }); - window.history.pushState = new Proxy(window.history.pushState, { + const proxyStateChange = new Proxy(window.history.pushState, { apply: (target, thisArg, argArray: PushStateInput) => { stopProgress(); return target.apply(thisArg, argArray); }, }); + + window.history.pushState = proxyStateChange; + window.history.replaceState = proxyStateChange; + }, []); return styles;