Haunted 🦇 🎃 React's Hooks API but for standard web components and hyperHTML or lit-html. <!doctype html> <html lang="en"> <my-counter></my-counter> <script type="module"> import { html } from 'https://unpkg.com/lit-html/lit-html.js'; import { component, useState } from 'https://unpkg.com/haunted/haunted.js'; function Counter() { const [count, setCount] = useState(0); return html` <div id="count">${count}</div> <button type="button" @click=${() => setCount(count + 1)}>Increment</button> `; } customElements.define('my-counter', component(Counter)); </script> Getting started A starter app is available on codesandbox and also can be cloned from this repo. This app gives you the basics of how to…
Hybrids is pretty cool. What do you think about Haunted?
Hadn't heard of it 'till now, and had to do some googling to find it:
matthewp / haunted
React's Hooks API implemented for web components 👻
Haunted🦇 🎃
React's Hooks API but for standard web components and hyperHTML or lit-html.
Getting started
A starter app is available on codesandbox and also can be cloned from this repo. This app gives you the basics of how to…
Looks worth a glance, maybe I'll write a post on it.
Thanks for the tip!