How to add scroll event in react component
<p>I'm trying to add an <code>onScroll</code> event on a table. This is what I've tried:</p>

<pre><code>componentDidMount() {
    ReactDOM.findDOMNode(this.refs.table).addEventListener('scroll', this.listenScrollEvent);
}

componentWillUnmount() {
    ReactDOM.findDOMNode(this.refs.table).removeEventListener('scroll', this.listenScrollEvent);
}

listenScrollEvent() {
    console.log('Scroll event detected!');
}

render() {
    return (
        &lt;table ref="table"&gt;
           [...]
        &lt;/table&gt;
    )
}
</code></pre>

<p>I tried <code>console.log(ReactDOM.findDOMNode(this.refs.table))</code> and I'm getting the correct result but scroll event is never fired at all. I looked in <a href="https://stackoverflow.com/questions/36180414/reactjs-add-custom-event-listener-to-component">here</a> but still failed. Any help would be so much appreciated.</p>