New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-attach-handler

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-attach-handler

React attach event handlers to targets.

Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
9
12.5%
Maintainers
1
Weekly downloads
 
Created
Source

react-attach-handler

React attach event handlers to targets.

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install react-attach-handler --save

Why?

THis module provides a reactjs way to bind events to global targets. It uses native React lifecycle to bind and unbind events.

Props

  • children, Element, default null.
  • target, (required) String or Object, default ''.
  • events, (required) Function or Object,
    • If events is an Object its accepts capture, passive & debounce as options.

Usage

example/src/app.jsx

import AttachHandler from '../../lib/AttachHandler';

class App extends Component {
    handleMouseMove = () => {
        console.log(`mousemove ${this.iamhere} Hello`);
    };

    iamhere = 'Something is here';

    render = () => {
        return (
            <section
                className="app">
                <AttachHandler
                    target="window"
                    events={{
                        resize: this.handleMouseMove,
                    }}
                    />
            </section>
        );
    }
}

Dependencies

Dev Dependencies

License

MIT

Keywords

react

FAQs

Package last updated on 14 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts