Skip to content

Commit

Permalink
fix: remove unnecessary use of apply in history.pushState and history…
Browse files Browse the repository at this point in the history
….replaceState calls
  • Loading branch information
tomcru committed Feb 26, 2024
1 parent 820bd33 commit 3b53593
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ const HolyLoader = ({
const originalPushState = history.pushState.bind(history);
history.pushState = (...args) => {
stopProgress();
originalPushState.apply(history, args);
originalPushState(...args);
};

// This is crucial for Next.js Link components using the 'replace' prop.
const originalReplaceState = history.replaceState.bind(history);
history.replaceState = (...args) => {
stopProgress();
originalReplaceState.apply(history, args);
originalReplaceState(...args);
};

isHistoryPatched = true;
Expand Down

0 comments on commit 3b53593

Please sign in to comment.