react-evt-listener

0.1.5 • Public • Published

react-evt-listener

npm

Install

npm install react-evt-listener

Example

import React, { Component } from 'react';
import EventListener from 'react-evt-listener';
 
class MyComponent extends Component {
  render() {
    return (
      <div>
        <EventListener target={window} eventName="resize">
          {
            (event) => {
              console.log('event', event);
            }
          }
        </EventListener>
      </div>
    );
  }
}

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i react-evt-listener

Weekly Downloads

1

Version

0.1.5

License

MIT

Unpacked Size

7.37 kB

Total Files

4

Last publish

Collaborators

  • goldenthumb