Home

Awesome

nerv-hyperscript Build Status

Hyperscript syntax for Nerv.js markup.

Usage

var h = require('nerv-hyperscript');
var Nerv = require('nerv');

var AnotherComponent = require('./another-component');

module.exports = Nerv.createClass({
  render: function render() {
    return (
      h('div.example', [
        h('h1#heading', 'This is hyperscript'),
        h('h2', 'creating Nerv.js markup'),
        h(AnotherComponent, {foo: 'bar'}, [
          h('li', [
            h('a', {href: 'http://whatever.com'}, 'One list item')
          ]),
          h('li', 'Another list item')
        ])
      ])
    );
  }
});

Documentation

Object.assign is used in this library and is not poly-filled.

h(componentOrTag, properties, children)

Returns a Nerv element.