We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 625c901 commit d9b1951Copy full SHA for d9b1951
1 file changed
packages/router-core/src/load-matches.ts
@@ -896,15 +896,12 @@ export async function loadMatches(arg: {
896
const route = inner.router.looseRoutesById[routeId]!
897
try {
898
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
- })
+ if (headResult) {
+ const head = await headResult
+ inner.updateMatch(matchId, (prev) => ({
+ ...prev,
+ ...head,
+ }))
908
}
909
} catch (err) {
910
// Don't let head execution errors break beforeLoad execution
0 commit comments