A lightweight signal-based library for building web components with a React-like API.
MIT License
A lightweight signal-based library for building web components with a React-like API.
import { Component, useSignal, defineComponents } from "sinho";
class Counter extends Component("x-counter") {
render() {
const [value, setValue] = useSignal(0);
return (
<>
<p>Counter: {value}</p>
<p>
<button onclick={() => setValue((n) => n + 1)}>Increment</button>{" "}
<button onclick={() => setValue((n) => n - 1)}>Decrement</button>
</p>
</>
);
}
}
defineComponents(Counter);