feat: island sub-directories (#1185)

This commit is contained in:
Asher Gomez
2023-05-31 05:29:56 +10:00
committed by GitHub
parent 8347eadbef
commit b5532aeb69
6 changed files with 56 additions and 66 deletions
+23
View File
@@ -0,0 +1,23 @@
import { useState } from "preact/hooks";
import { IS_BROWSER } from "$fresh/runtime.ts";
interface CounterProps {
start: number;
id: string;
}
export default function Counter(props: CounterProps) {
const [count, setCount] = useState(props.start);
return (
<div id={props.id}>
<p>{count}</p>
<button
id={`b-${props.id}`}
onClick={() => setCount(count + 1)}
disabled={!IS_BROWSER}
>
+1
</button>
</div>
);
}