diff --git a/packages/start/islands/index.tsx b/packages/start/islands/index.tsx index eaa69ec54..8c7d03bd1 100644 --- a/packages/start/islands/index.tsx +++ b/packages/start/islands/index.tsx @@ -1,8 +1,7 @@ -import { Component, ComponentProps, lazy, sharedConfig } from "solid-js"; +import { Component, ComponentProps, createUniqueId, lazy, sharedConfig } from "solid-js"; import { Hydration, NoHydration } from "solid-js/web"; import { useRequest } from "../server/ServerContext"; import { IslandManifest } from "../server/types"; -import { splitProps } from "./utils"; export { default as clientOnly } from "./clientOnly"; declare module "solid-js" { @@ -66,8 +65,12 @@ export function island>( return ; } + // FIXME Introduce a new ID generation scheme + // for islands + const id = createUniqueId(); + sharedConfig.context.serialize( - // TODO how to get the ID? + id, props, ); @@ -75,6 +78,7 @@ export function island>( return ( createComponent(Component, props[0]), el, { - renderId: hk.slice(0, hk.length - 1) + `${1 + Number(el.dataset.offset)}-`, + renderId: el.dataset.id, owner: lookupOwner(el) });