2 ms·
You can just make a function that generates HTML string like h("div", { class: "container" }, [ h("p", {}, "oh hi!"), ...projects.map(rende
by slmjkdbtl 3y ago
You can just make a function that generates HTML string like
h("div", { class: "container" }, [
h("p", {}, "oh hi!"),
...projects.map(renderProject),
])
the end result will have no JS if all you want is reuse HTML parts, much better than template languages imo (no additional syntax, has loops / functions / variables out of the box)