function Counter() { const [value, setValue] = useState(0); return ( <> <div>Counter: {value}</div> <button onClick={() => setValue(value + 1)}>Increment</button> <button onClick={() => setValue(value - 1)}>Decrement</button> </> ) } Closer to the DOM Preact provides the thinnest possible Virtual DOM abstraction on top of the DOM. It builds on stable platform features, registers real event handler
![Preact | Preact: Fast 3kb React alternative with the same ES6 API. Components & Virtual DOM.](https://cdn-ak-scissors.b.st-hatena.com/image/square/d666620a09679111a201b4baed53be65b0a48f4b/height=288;version=1;width=512/https%3A%2F%2Fpreactjs.com%2Fapp-icon.png)