@catchad/react-window-event
v0.0.7
Published
Make adding eventlistener to Window much more react way.
Downloads
20
Readme
react-window-event
Install
yarn add @catchad/react-window-event
Usage
import React, { Component } from 'react';
import ReactWindowEvent from '@catchad/react-window-event';
class WindowEvent extends Component {
handleScroll = e => {
console.log(e);
};
render() {
return (
<div>
<ReactWindowEvent type="scroll" listener={this.handleScroll} />
</div>
);
}
}
export default WindowEvent;