feat: add context information to render function (#46)

This commit is contained in:
Luca Casonato
2021-08-06 18:08:48 +02:00
committed by GitHub
parent 3bce2fb8d3
commit 0777c1c7ba
9 changed files with 116 additions and 61 deletions
+11 -9
View File
@@ -80,15 +80,17 @@ export default function Home() {
function Counter() {
const [count, setCount] = useState(0);
return <div>
<p>{count}</p>
<button onClick={() => setCount(count - 1)} disabled={!IS_BROWSER}>
-1
</button>
<button onClick={() => setCount(count + 1)} disabled={!IS_BROWSER}>
+1
</button>
</div>;
return (
<div>
<p>{count}</p>
<button onClick={() => setCount(count - 1)} disabled={!IS_BROWSER}>
-1
</button>
<button onClick={() => setCount(count + 1)} disabled={!IS_BROWSER}>
+1
</button>
</div>
);
}
`;
await Deno.writeTextFile(