react-evt-listener
v0.1.5
Published
A React component for binding events
Downloads
3
Readme
react-evt-listener
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