0.0.1 • Published 6 years ago

@skatejs/element-snabbdom v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

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.