Skip to content

Commit d9b1951

Browse files
committed
chore: remove thenable
1 parent 625c901 commit d9b1951

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

packages/router-core/src/load-matches.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -896,15 +896,12 @@ export async function loadMatches(arg: {
896896
const route = inner.router.looseRoutesById[routeId]!
897897
try {
898898
const headResult = executeHead(inner, matchId, route)
899-
if (headResult && isPromise(headResult)) {
900-
await headResult.then(head => {
901-
if (head) {
902-
inner.updateMatch(matchId, (prev) => ({
903-
...prev,
904-
...head,
905-
}))
906-
}
907-
})
899+
if (headResult) {
900+
const head = await headResult
901+
inner.updateMatch(matchId, (prev) => ({
902+
...prev,
903+
...head,
904+
}))
908905
}
909906
} catch (err) {
910907
// Don't let head execution errors break beforeLoad execution

0 commit comments

Comments
 (0)