0.1.1 • Published 5 years ago

component-register-preact v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Component Register Preact

This is a Component Register HOC (decorator/mixin) to support Preact Components. Component props are passed through as Preact props.

import { register, compose } from 'component-register'
import { customElement } from 'component-register-preact'
import { Component }  from 'preact'

// Normal Preact Component
class MyComponent extends Component {
  constructor(props) {
    this.state = {greeting: 'Hello'}
  }

  render() {
    return <div>{this.state.greeting + ' ' + this.props.recipient}</div>
  }
}

customElement('my-component', {recipient: 'John'}, MyComponent)

This library also supports Stateless pure function components.

0.1.1

5 years ago

0.1.0

5 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago