Bind the onWheel listener directly to props

React doesn't seem to care if this is null/undefined.
pull/21833/head
Travis Ralston 2019-04-05 09:43:29 -06:00
parent 138fd4ec87
commit 17a57eb3e5
1 changed files with 1 additions and 7 deletions

View File

@ -118,19 +118,13 @@ export default class AutoHideScrollbar extends React.Component {
return this.containerRef.scrollTop;
}
onWheel = (e) => {
if (this.props.onWheel) {
this.props.onWheel(e);
}
};
render() {
return (<div
ref={this._collectContainerRef}
style={this.props.style}
className={["mx_AutoHideScrollbar", this.props.className].join(" ")}
onScroll={this.props.onScroll}
onWheel={this.onWheel}
onWheel={this.props.onWheel}
>
<div className="mx_AutoHideScrollbar_offset">
{ this.props.children }