0.1.1 • Published 4 years ago

component-register-preact v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 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

4 years ago

0.1.0

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago