mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-24 04:25:34 +08:00
fix: typo in logic of getStateFromPath (#8868)
What just randomly reading, but I think there's a typo
```
['ab', 'aba'].sort((a, b) => {
if (a.startsWith(b)) {
return -1;
}
if (b.startsWith(a)) {
return 1;
}
});
(2) ["aba", "ab"]
['ab', 'a'].sort((a, b) => {
if (a.startsWith(b)) {
return -1;
}
if (b.startsWith(a)) {
return 1;
}
});
(2) ["ab", "a"]
```
This commit is contained in:
committed by
GitHub
parent
050447b9ac
commit
97c215d2f2
@@ -122,7 +122,7 @@ export default function getStateFromPath(
|
||||
// If one of the patterns starts with the other, it's more exhaustive
|
||||
// So move it up
|
||||
if (a.pattern.startsWith(b.pattern)) {
|
||||
return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (b.pattern.startsWith(a.pattern)) {
|
||||
|
||||
Reference in New Issue
Block a user