2.0.0 • Published 8 years ago

append-instance v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 years ago

Decorator to add the component’s instance to the event handler’s arguments.

Installation

npm install --save append-instance

Usage

import React, { Component } from 'react'
import { defaultPresenter, presentable } from 'presentable'
import appendInstance from 'append-instance'
import presentable from 'presentable'
import themeable from 'themeable'

@appendInstance
@presentable
class SomeComponent extends Component {}
// Or...
@appendInstance
@themeable
class SomeComponent extends Component {}

// The first parameter will be the normal one sent by React’s synthetic event,
// and the last one will be the component’s instance.
function handler(e, s) {
  // ...
}

<SomeComponent onClick={handler}/>
2.0.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago