![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
mb-react-infinite-scroll
Advanced tools
#infinite-scroll
##安装方法
npm i -S mb-react-infinite-scroll
##用法
import InfiniteScroll from 'mb-react-infinite-scroll';
...
<InfiniteScroll onLoad={this.loadMore.bind(this)} hasMore={true} height="100%">
{(()=> {
return this.state.items.map((item)=> {
return <Item text={item}/>
})
})()}
</InfiniteScroll>
onLoad:在该组件滚动到底部时调用,获取更多数据,需要返回Promise类型对象
height:
请参考example
onLoad
加载数据用的 function, 要求返回 Promiseretry
失败后点击重试的 function, 要求返回 PromisehasMore
是否有更多数据, 在没有数据后设置该属性为true,将不再请求height
默认100%,用来确保该组件高度小于内容以便出现滚动条langNoMore
没有更多数据的文本内容langLoading
加载中的文本内容FAQs
##安装方法
The npm package mb-react-infinite-scroll receives a total of 1 weekly downloads. As such, mb-react-infinite-scroll popularity was classified as not popular.
We found that mb-react-infinite-scroll demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.