Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
fix(useBackLink): Preserve array indexes when handling redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
diondiondion committed Jan 29, 2021
1 parent 662982b commit 3b2ed86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useBackLink/BackLinkProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function removePreviousEntry(history, indexes) {
if (newHistory[x]) {
newHistory[x].splice(y, 1);
if (newHistory[x].length === 0) {
newHistory.splice(x, 1);
newHistory[x] = undefined;
}
}
return newHistory;
Expand Down

0 comments on commit 3b2ed86

Please sign in to comment.