loading
前言
在本篇文章你将会学到:
IntersectionObserver API
的用法,以及如何兼容。- 如何在
React Hook
中实现无限滚动。 - 如何正确渲染多达10000个元素的列表。 无限下拉加载技术使用户在大量成块的内容面前一直滚动查看。这种方法是在你向下滚动的时候不断加载新内容。
当你使用滚动作为发现数据的主要方法时,它可能使你的用户在网页上停留更长时间并提升用户参与度。随着社交媒体的流行,大量的数据被用户消费。无线滚动提供了一个高效的方法让用户浏览海量信息,而不必等待页面的预加载。
如何构建一个体验良好的无限滚动,是每个前端无论是项目或面试都会碰到的一个课题。