Skip to content

v1.1.0: Components!

Choose a tag to compare

@aduth aduth released this 05 Jun 02:36
· 64 commits to master since this release

🚀 New Features

  • Compose reusable components. When passed a function as the first argument, render behavior is deferred to this function; passed attributes including children, the function is expected to return an HTMLElement.

Example:

function Heading( attributes ) {
  return h( 'h' + attributes.level, attributes.children );
}

var element = h( 'div',
  h( Heading, { level: 2 }, 'Example' ),
  'Content'
);