react-action-decorators
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

React Action Decorators

Remove menial event handling

Example

import React from 'react';
import { withTemplateHelpers } from 'react-action-decorators';
 
@withTemplateHelpers
export default class MyComponent extends Component {
    render() {
        const { mut } = this;
        const { text } = this.state;
 
        return (
            <div>
              <input value={text} onChange={mut('text')} />
            </div>
        );
    }
}

Demo: https://codesandbox.io/s/2067py0prn

Available Helpers

  • mut
  • toggle
  • pipe

Readme

Keywords

none

Package Sidebar

Install

npm i react-action-decorators

Weekly Downloads

14

Version

0.0.4

License

MIT

Unpacked Size

9.95 kB

Total Files

16

Last publish

Collaborators

  • nullvoxpopuli