fix: show marker confusion (#1823)

This commit is contained in:
Marvin Hagemeister
2023-09-26 11:54:36 +02:00
committed by GitHub
parent 5a47ffaf59
commit 78606477ec
6 changed files with 337 additions and 359 deletions
@@ -31,6 +31,7 @@ import * as $$7 from "./islands/IslandFn.tsx";
import * as $$8 from "./islands/IslandInsideIsland.tsx";
import * as $$9 from "./islands/IslandWithProps.tsx";
import * as $$10 from "./islands/PassThrough.tsx";
import * as $$11 from "./islands/ReadyMarker.tsx";
const manifest = {
routes: {
@@ -65,6 +66,7 @@ const manifest = {
"./islands/IslandInsideIsland.tsx": $$8,
"./islands/IslandWithProps.tsx": $$9,
"./islands/PassThrough.tsx": $$10,
"./islands/ReadyMarker.tsx": $$11,
},
baseUrl: import.meta.url,
};
@@ -0,0 +1,15 @@
import { useSignal } from "@preact/signals";
import { useEffect } from "preact/hooks";
export function ReadyMarker() {
const sig = useSignal(false);
useEffect(() => {
sig.value = true;
}, []);
return (
<p class={sig.value ? "mounted" : "pending"}>
{sig.value ? "mounted" : "pending"}
</p>
);
}
@@ -2,6 +2,7 @@ import IslandConditional from "../islands/IslandConditional.tsx";
import BooleanButton from "../islands/BooleanButton.tsx";
import { useSignal } from "@preact/signals";
import Counter from "../islands/Counter.tsx";
import { ReadyMarker } from "../islands/ReadyMarker.tsx";
export default function Page() {
const show = useSignal(true);
@@ -16,6 +17,7 @@ export default function Page() {
</div>
</IslandConditional>
<BooleanButton signal={show} />
<ReadyMarker />
</div>
);
}