diff --git a/js/people.js b/js/people.js index 892d654..a661836 100644 --- a/js/people.js +++ b/js/people.js @@ -2,6 +2,7 @@ import Preact from "preact"; import { html } from "htm"; import { Consumer } from "./store.js"; import * as Tree from "./tree.js"; +import React from "preact"; /** @typedef {(e:SubmitEvent|Event)=>void|null} handler */ @@ -83,10 +84,17 @@ const PersonForm = () => { /** @type {()=>preact.VNode} */ export default () => { + let [countGet, countSet] = Preact.useState(0); + + let ref = Preact.useRef(null); + Tree.useAway(ref, () => { + countSet(countGet + 1); + }); + return html`