Skip to content

Commit

Permalink
fix(react-router): kick off loader early (#2368)
Browse files Browse the repository at this point in the history
  • Loading branch information
schiller-manuel committed Sep 18, 2024
1 parent c17982e commit 4e6e66f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/react-router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2275,11 +2275,6 @@ export class Router<
componentsPromise,
}))

// Lazy option can modify the route options,
// so we need to wait for it to resolve before
// we can use the options
await route._lazyPromise

// Kick off the loader!
let loaderData =
await route.options.loader?.(getLoaderContext())
Expand All @@ -2300,6 +2295,11 @@ export class Router<
loaderData,
)

// Lazy option can modify the route options,
// so we need to wait for it to resolve before
// we can use the options
await route._lazyPromise

await potentialPendingMinPromise()

const meta = route.options.meta?.({
Expand Down

0 comments on commit 4e6e66f

Please sign in to comment.