From 379293d940dc2ef0d6cee738b3ab55b5c733f07a Mon Sep 17 00:00:00 2001 From: Nyi Nyi Lwin Date: Tue, 24 Sep 2024 01:17:23 +0700 Subject: [PATCH] use correct hydration id in server lazy (#2303) * use correct hydration id in server lazy * Create smart-drinks-reply.md --------- Co-authored-by: Ryan Carniato --- .changeset/smart-drinks-reply.md | 5 +++++ packages/solid/src/server/rendering.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/smart-drinks-reply.md diff --git a/.changeset/smart-drinks-reply.md b/.changeset/smart-drinks-reply.md new file mode 100644 index 000000000..749b042ab --- /dev/null +++ b/.changeset/smart-drinks-reply.md @@ -0,0 +1,5 @@ +--- +"solid-js": patch +--- + +use correct hydration id in server lazy diff --git a/packages/solid/src/server/rendering.ts b/packages/solid/src/server/rendering.ts index aeca5bbcb..425e77350 100644 --- a/packages/solid/src/server/rendering.ts +++ b/packages/solid/src/server/rendering.ts @@ -493,7 +493,7 @@ export function lazy>( const wrap: Component> & { preload?: () => Promise<{ default: T }>; } = props => { - const id = sharedConfig.context!.id.slice(0, -1); + const id = sharedConfig.context!.id; let ref = sharedConfig.context!.lazy[id]; if (ref) p = ref; else load(id);