简体   繁体   English

JS React网站的最佳无限滚动工具/组件?

[英]Best infinite scroll tool/component for JS React website?

I'm very new to JavaScript and currently using JSX to design a website. 我对JavaScript非常陌生,目前正在使用JSX设计网站。 I am hoping to add an infinite scroll component where the user scrolls to the bottom of a list of, say, 5 images, and then 5 more load, etc. 我希望添加一个无限滚动组件,用户可以滚动到该列表的底部,例如5张图片,然后再加载5张图片,等等。

I have built my own rest API server and plan to implement my JS such that upon each user scroll to the bottom, it will call on this API to load the data for another 5 images; 我已经构建了自己的rest API服务器,并计划实现我的JS,以便在每个用户滚动到最底端时,它将调用此API来加载另外5张图片的数据; however, I am lost on how to best handle this scroll event by the user. 但是,我不知道如何最好地处理用户的滚动事件。

I am trying to find a tool/component that would help me implement this scroll that is already embedded in the standard React library. 我试图找到一个工具/组件来帮助我实现已经嵌入在标准React库中的滚动条。 It is important that this is not something I have to install outside of the React library . 重要的是,这不是我必须在React库之外安装的东西 I have read through tons of React documentation and SO posts, but have been unable to find one- could someone point me in the right direction? 我已经阅读了大量的React文档和SO帖子,但找不到一个-有人可以指出我正确的方向吗?

This one should do the work react-infinite 这个应该做的工作无穷大

Or native 本地

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM