Skip to content

Commit

Permalink
Remove IE 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Sep 9, 2021
1 parent 1272bb1 commit f6df069
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 0 additions & 2 deletions .browserslistrc
@@ -1,9 +1,7 @@
# Browsers we support
> 0.5%
Chrome >= 73
ChromeAndroid >= 75
Firefox >= 67
Edge >= 17
IE 11
Safari >= 12.1
iOS >= 11.3
11 changes: 1 addition & 10 deletions packages/react-router/index.tsx
Expand Up @@ -827,9 +827,7 @@ function rankRouteBranches(branches: RouteBranch[]): void {
return memo;
}, {});

// Sorting is stable in modern browsers, but we still support IE 11, so we
// need this little helper.
stableSort(branches, (a, b) => {
branches.sort((a, b) => {
let [aPath, , aIndexes] = a;
let aScore = pathScores[aPath];

Expand Down Expand Up @@ -885,13 +883,6 @@ function compareIndexes(a: number[], b: number[]): number {
0;
}

function stableSort(array: any[], compareItems: (a: any, b: any) => number) {
// This copy lets us get the original index of an item so we can preserve the
// original ordering in the case that they sort equally.
let copy = array.slice(0);
array.sort((a, b) => compareItems(a, b) || copy.indexOf(a) - copy.indexOf(b));
}

function matchRouteBranch<ParamKey extends string = string>(
branch: RouteBranch,
pathname: string
Expand Down

0 comments on commit f6df069

Please sign in to comment.