update example
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { h, useState } from "../deps.ts";
|
||||
import { h, IS_BROWSER, useState } from "../deps.ts";
|
||||
|
||||
export default function Home() {
|
||||
return (
|
||||
@@ -8,6 +8,7 @@ export default function Home() {
|
||||
file, and refresh.
|
||||
</p>
|
||||
<Counter />
|
||||
<p>{IS_BROWSER ? "Viewing JIT render." : "Viewing browser render."}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -16,7 +17,11 @@ function Counter() {
|
||||
const [count, setCount] = useState(0);
|
||||
return <div>
|
||||
<p>{count}</p>
|
||||
<button onClick={() => setCount(count - 1)}>-1</button>
|
||||
<button onClick={() => setCount(count + 1)}>+1</button>
|
||||
<button onClick={() => setCount(count - 1)} disabled={!IS_BROWSER}>
|
||||
-1
|
||||
</button>
|
||||
<button onClick={() => setCount(count + 1)} disabled={!IS_BROWSER}>
|
||||
+1
|
||||
</button>
|
||||
</div>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user