@skatejs/element-snabbdom
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

element-snabbdom

SkateJS renderer for Snabbdom

Install

npm i @skatejs/element-snabbdom snabbdom

Usage

import Element, { h } from '@skatejs/element-snabbdom';

class Hello extends Element {
  static modules = [
    require('snabbdom/modules/attributes').default,
    require('snabbdom/modules/eventlisteners').default,
    require('snabbdom/modules/class').default,
    require('snabbdom/modules/props').default,
    require('snabbdom/modules/style').default,
    require('snabbdom/modules/dataset').default
  ];
  render() {
    return h('div', `Hello, `, h('slot'), '!');
  }
}

customElements.define('x-hello', Hello);

It's possible to use JSX via snabbdom-pragma.

Package Sidebar

Install

npm i @skatejs/element-snabbdom

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

7.49 kB

Total Files

6

Last publish

Collaborators

  • treshugart