fix(vite): partial island loading (#3226)

This commit is contained in:
Marvin Hagemeister
2025-08-19 17:58:17 +02:00
committed by GitHub
parent afdf5eaf6c
commit ffa57be765
6 changed files with 98 additions and 1 deletions
@@ -0,0 +1,15 @@
import { useEffect, useState } from "preact/hooks";
export function ReadyIsland() {
const [ready, set] = useState(false);
useEffect(() => {
set(true);
}, []);
return (
<div class={ready ? "ready" : "not-ready"}>
{ready ? "ready" : "waiting..."}
</div>
);
}
@@ -0,0 +1,14 @@
import { Partial } from "@fresh/core/runtime";
import { ReadyIsland } from "../../islands/tests/Ready.tsx";
export default function Page() {
return (
<div f-client-nav>
<h1>Partial</h1>
<Partial name="partial-test">
<a href="/tests/partial_insert">click me</a>
</Partial>
<ReadyIsland />
</div>
);
}
@@ -0,0 +1,10 @@
import { Partial } from "@fresh/core/runtime";
import { CounterHooks } from "../../islands/tests/CounterHooks.tsx";
export default function Page() {
return (
<Partial name="partial-test">
<CounterHooks />
</Partial>
);
}