1.3.0 • Published 8 years ago

breact v1.3.0

Weekly downloads
46
License
MIT
Repository
github
Last release
8 years ago

breact

Build Status npm Version JS Standard

Browser react utility

Installation

$ npm install breact --save

Usage

'use strict'

import {mount, create, once} from 'breact'
import IndexComponent from '../components/index_component'

once('DOMContentLoaded', () => {
  let element = create(IndexComponent, {})
  mount('mount-root', element).then(() => {
    // The component is ready.
  })
})

Functions

Available functions

SignatureDescription
autobind(context) ->Auto bind methods
create(Component, props, children) -> ObjectCreate an element
markup(Component, props, children) -> stringCreate static markup
mount(container, element) -> PromiseMount an element into dom
once(event, handler)Bind window event once
wrap(Base, spec) -> ObjectWrap a element with higher order component

License

This software is released under the MIT License.

Links