3 ms·
If you just want to make vanilla js reactive, you can use solid js but without jsx (or something similar). This library could likely do the same. import {
by pfg_ 3y ago
If you just want to make vanilla js reactive, you can use solid js but without jsx (or something similar). This library could likely do the same.
import { createRoot, createSignal, createRenderEffect } from "solid-js";
function SomeComponent() {
const [count, setCount] = createSignal(0);
const result = document.createElement("button");
createRenderEffect(() => result.textContent = "++ (" + count() + ")");
result.onclick = () => setCount(count() + 1);
return result;
}
createRoot(cleanup => {
const appv = document.getElementById("app");
appv.appendChild(SomeComponent());
});