feat: add context information to render function (#46)
This commit is contained in:
+11
-9
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user