Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript ReactJS滚动事件绑定到组件外部的函数_Javascript_Reactjs - Fatal编程技术网

Javascript ReactJS滚动事件绑定到组件外部的函数

Javascript ReactJS滚动事件绑定到组件外部的函数,javascript,reactjs,Javascript,Reactjs,我有一个由React生成的表,该表由在API回调中激发render的函数生成。我很难弄清楚如何通过调用这个div的滚动事件找到这个函数。我的理解是components.js应该只进行渲染,将API调用函数作为函数放在组件中是糟糕的设计。我如何实现这种绑定 React.createElement("div", {id: "queue-list-content", className: "queue-list-content", onScroll: this.handleScroll} handl

我有一个由React生成的表,该表由在API回调中激发render的函数生成。我很难弄清楚如何通过调用这个div的滚动事件找到这个函数。我的理解是components.js应该只进行渲染,将API调用函数作为函数放在组件中是糟糕的设计。我如何实现这种绑定

React.createElement("div", {id: "queue-list-content", className: "queue-list-content", onScroll: this.handleScroll}

handleScroll: function(){
  //trying to call function that lives in the file with the rest of the API calling functions here
}