Skip to content

Commit

Permalink
Handle scenario where there is only a root route in SPA mode
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Feb 13, 2024
1 parent dd1c09b commit 16146ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/remix-react/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ export function createServerRoutes(
index: route.index,
path: route.path,
handle: routeModule.handle,
// For SPA Mode, all routes are lazy except root. We don't need a full
// implementation here though - just need a `lazy` prop to tell the RR
// rendering where to stop
lazy:
isSpaMode && route.id !== "root" ? () => spaModeLazyPromise : undefined,
// For SPA Mode, all routes are lazy except root. However we tell the
// router root is also lazy here too since we don't need a full
// implementation - we just need a `lazy` prop to tell the RR rendering
// where to stop which is always at the root route in SPA mode
lazy: isSpaMode ? () => spaModeLazyPromise : undefined,
// For partial hydration rendering, we need to indicate when the route
// has a loader/clientLoader, but it won't ever be called during the static
// render, so just give it a no-op function so we can render down to the
Expand Down

0 comments on commit 16146ca

Please sign in to comment.