This commit adds support for passing signals to islands in component props. This is useful for passing around mutable state between islands. The signal's value needs to be serializable for this to work.
18 lines
417 B
TypeScript
18 lines
417 B
TypeScript
import { useSignal } from "@preact/signals";
|
|
import Counter from "../islands/Counter.tsx";
|
|
|
|
export default function Home() {
|
|
const count = useSignal(3);
|
|
return (
|
|
<div>
|
|
<p>
|
|
Welcome to Fresh. Try to update this message in the ./routes/index.tsx
|
|
file, and refresh.
|
|
</p>
|
|
<Counter count={count} />
|
|
<Counter count={count} />
|
|
<Counter count={count} />
|
|
</div>
|
|
);
|
|
}
|