@@ -40,6 +40,7 @@ import type { RouteMatch, RouteObject } from "../context";
4040import invariant from "../server-runtime/invariant" ;
4141
4242import {
43+ Outlet as UNTYPED_Outlet ,
4344 UNSAFE_WithComponentProps ,
4445 UNSAFE_WithHydrateFallbackProps ,
4546 UNSAFE_WithErrorBoundaryProps ,
@@ -48,13 +49,15 @@ import {
4849 // TSConfig, it breaks the Parcel build within this repo.
4950} from "react-router/internal/react-server-client" ;
5051import type {
52+ Outlet as OutletType ,
5153 WithComponentProps as WithComponentPropsType ,
5254 WithErrorBoundaryProps as WithErrorBoundaryPropsType ,
5355 WithHydrateFallbackProps as WithHydrateFallbackPropsType ,
5456 RouteComponentProps ,
5557 ErrorBoundaryProps ,
5658 HydrateFallbackProps ,
5759} from "../components" ;
60+ const Outlet : typeof OutletType = UNTYPED_Outlet ;
5861const WithComponentProps : typeof WithComponentPropsType =
5962 UNSAFE_WithComponentProps ;
6063const WithErrorBoundaryProps : typeof WithErrorBoundaryPropsType =
@@ -1016,8 +1019,9 @@ async function getRSCRouteMatch(
10161019 const actionData = staticContext . actionData ?. [ match . route . id ] ;
10171020 const params = match . params ;
10181021 // TODO: DRY this up once it's fully fleshed out
1019- const element =
1020- Component && shouldRenderComponent
1022+ let element : React . ReactElement | undefined = undefined ;
1023+ if ( Component ) {
1024+ element = shouldRenderComponent
10211025 ? React . createElement (
10221026 Layout ,
10231027 null ,
@@ -1034,8 +1038,8 @@ async function getRSCRouteMatch(
10341038 ) ,
10351039 } satisfies RouteComponentProps ) ,
10361040 )
1037- : // TODO: Render outlet instead?
1038- undefined ;
1041+ : React . createElement ( Outlet ) ;
1042+ }
10391043 let error : unknown = undefined ;
10401044
10411045 if ( ErrorBoundary && staticContext . errors ) {
0 commit comments