You missed hooks in WickedElements, don't worry anymore Andrea provided them for us :-)
You can test it here : HookedElements
<button class="counter"></button>
<button class="counter"></button>
<button class="counter"></button>
// define via callback to receives the element right away
import {define, useState} from 'hooked-elements';
define('button.counter', element => {
const [count, update] = useState(0);
element.onclick = () => update(count + 1);
element.textContent = `${count} clicks`;
});
Top comments (0)