breact

Browser react utility

  • breact

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
breact
001.3.06 years ago6 years agoMinified + gzip package size for breact in KB

Readme

breact


!Build Statusbdtravisshieldurlbdtravisurl !npm Versionbdnpmshieldurlbdnpmurl !JS Standardbdstandardshieldurlbdstandardurl


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
| Signature | Description | | ---- | ----------- | | autobind(context) -> | Auto bind methods | | create(Component, props, children) -> Object | Create an element | | markup(Component, props, children) -> string | Create static markup | | mount(container, element) -> Promise | Mount an element into dom | | once(event, handler) | Bind window event once | | wrap(Base, spec) -> Object | Wrap a element with higher order component |


License

This software is released under the MIT License.

Links