new example

This commit is contained in:
Luca Casonato
2021-05-08 12:57:33 +02:00
parent cfb99ef326
commit f42fff1a31
6 changed files with 65 additions and 14 deletions
+9 -10
View File
@@ -1,12 +1,11 @@
import { h, PageProps, useState } from "../deps.ts";
import { h } from "../deps.ts";
export default function Home(props: PageProps) {
const [counter, setCounter] = useState(0);
return (
<div>
Hello {props.params.name}! {counter}{" "}
<button onClick={() => setCounter(counter + 1)}>+1</button>
</div>
);
interface Props {
params: {
name: string;
};
}
export default function Greet(props: Props) {
return <div>Hello {props.params.name}</div>;
}