react-evt-listener
0.1.5 • Public • Published 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
Package Sidebar
Install
Weekly Downloads