From 254076ce30ac4f085da8f13e7520506b63c93b16 Mon Sep 17 00:00:00 2001 From: codehz Date: Fri, 29 Dec 2023 22:57:45 +0800 Subject: [PATCH] add route parameter to shell --- hydrate.tsx | 5 ++++- index.tsx | 2 +- router/index.tsx | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hydrate.tsx b/hydrate.tsx index cb0b18f..031f58a 100644 --- a/hydrate.tsx +++ b/hydrate.tsx @@ -28,7 +28,10 @@ export async function hydrate( return hydrateRoot( document, - + , diff --git a/index.tsx b/index.tsx index 4891f55..5f86dfb 100644 --- a/index.tsx +++ b/index.tsx @@ -89,7 +89,7 @@ export class StaticRouters { }); } const stream = await renderToReadableStream( - + , { diff --git a/router/index.tsx b/router/index.tsx index 0fe99ac..1398670 100644 --- a/router/index.tsx +++ b/router/index.tsx @@ -69,7 +69,7 @@ export const RouterHost = ({ onRouteUpdated, }: { children: React.ReactElement; - Shell: React.ComponentType<{ children: React.ReactElement }>; + Shell: React.ComponentType<{ children: React.ReactElement; route?: string }>; onRouteUpdated?: (path: string) => void; }) => { const pathname = useLocationProperty( @@ -95,7 +95,7 @@ export const RouterHost = ({ onRouteUpdated?.(target); setVersion(currentVersion); setCurrent( - + );