@sebastbake/h

An alternative implementation of the excellent hyperscript library. Makes use of typescript 4.1 template literal types to infer element types.

Usage no npm install needed!

<script type="module">
  import sebastbakeH from 'https://cdn.skypack.dev/@sebastbake/h';
</script>

README

h

size downloads npm GitHub

An alternative implementation of the excellent hyperscript library. Makes use of typescript 4.1 template literal types to infer element types.

  • Supports SVG elements.
const element = h("div#someId", { onclick: handleClick }, [
  h("p.someClass", "Hello"),
  h("p.someClass", "World"),
]);

// Type inferred using typescript 4.1 beta template literals
type MyElement = typeof element; // HTMLDivElement