Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mb-react-infinite-scroll

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mb-react-infinite-scroll

##安装方法

  • 1.2.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

#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

API

  • onLoad 加载数据用的 function, 要求返回 Promise
  • retry 失败后点击重试的 function, 要求返回 Promise
  • hasMore 是否有更多数据, 在没有数据后设置该属性为true,将不再请求
  • height 默认100%,用来确保该组件高度小于内容以便出现滚动条
  • langNoMore 没有更多数据的文本内容
  • langLoading 加载中的文本内容

FAQs

Package last updated on 27 Sep 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc