How to add scroll event in react component

前端 未结 6 1981
逝去的感伤
逝去的感伤 2021-01-03 20:39

I\'m trying to add an onScroll event on a table. This is what I\'ve tried:

componentDidMount() {
    ReactDOM.findDOMNode(this.refs.table).addEv         


        
6条回答
  •  执笔经年
    2021-01-03 21:08

    You need to bind this to the element in context.

    render() {
        return (
            
               [...]
            
    ) }

提交回复
热议问题