npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-smartrefreshlayout-next

v0.5.1

Published

基于android SmartRefreshLayout的封装

Readme

react-native-SmartRefreshLayoutnpm version

基于android SmartRefreshLayout https://github.com/scwang90/SmartRefreshLayout 开发的插件,可提供类似ios的弹性刷新、加载,如果你喜欢,请不要吝啬你的 :smile: star :smile:

第一步

工程目录下运行 npm install --save react-native-smartrefreshlayout 或者 yarn add react-native-smartrefreshlayout(已经安装了yarn)

第二步

运行 react-native link react-native-smartrefreshlayout

第三部使用

在工程中导入:

import {SmartRefreshControl,ClassicsHeader,StoreHouseHeader,DefaultHeader} from 'react-native-smartrefreshlayout';

//使用方法和RN官方的RefreshControl类似,
<ScrollView 
  refreshControl={<SmartRefreshControl
     ref={refreshcontrol=>this.refreshControl=refreshcontrol}
     HeaderComponent={<DefaultHeader/>}
     onRefresh={()=>{
       setTimeout(()=>{
       this.refreshControl && this.refreshControl.finishRefresh();
       },1000)
     }}
  />}
>
</ScrollView>

组件

SmartRefreshControl

属性表格

|属性名|类型|描述| |:---:|:---:|:---:| |onRefresh|func|刷新触发| |enableRefresh|bool|是否启用刷新| |HeaderComponent|Component|refreshcontrol的header|

注意:HeaderComponet现在只能是插件提供的Header,后续我们将改进与提供任何Component

方法表格

|方法名|参数|描述| |:---:|:---:|:---:| |finishRefresh|{delayed:number,success:bool}|完成刷新|

ClassicsHeader/DefaultHeader

属性表格

|属性名|类型|描述| |:---:|:---:|:---:| |primaryColor|string|主题色| |accentColor|string|强调色|

StoreHouseHeader

属性表格

|属性名|类型|描述| |:---:|:---:|:---:| |text|string|文字(目前只支持英文)| |textColor|string|文字颜色| |lineWidth|number|线宽|

示例