Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pull To Refresh for PWA React JS

License

NotificationsYou must be signed in to change notification settings

cuongdevjs/pull-to-refresh-react

Pull To Refresh for Progressive Web Application (only Mobile) React JS

npm versionJavaScript Style Guide

Install

npm i pull-to-refresh-react

Link Demo (Turn on mobile mode)

Usage

importReact,{Component}from'react'importPullToRefreshfrom"pull-to-refresh-react";classAppextendsComponent{onRefresh(){returnnewPromise((resolve,reject)=>{setTimeout(()=>{resolve();},5000);});}test(){alert("click");}render(){return(<PullToRefreshoptions={{pullDownHeight:100}}onRefresh={this.onRefresh}><divstyle={{height:"500px",width:"100%",backgroundColor:"blur",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"}}><div>Nguyen Manh Cuong - CuongStf</div><buttonstyle={{border:"1px solid black"}}onClick={()=>this.test()}>            Event Disabled when refreshing</button></div></PullToRefresh>);}}

Prop

PropTypeDefaultDescription
onRefreshasync function (required)-Function happend when onRefresh
textErrorstring (optional)ErrorText display when error
textStartstring (optional)StartText display when start touch
textReadystring (optional)ReadyText display when ready onRefresh
textRefreshstring (optional)RefreshText display when refreshing
optionsobject (optional){ pullDownHeight: 60 }{ pullDownHeight: height of Pull Down }

Resource

Inspired fromvue-pull-refresh

License

MIT ©CuongStf

Releases

No releases published

Sponsor this project

    Packages

    No packages published

    [8]ページ先頭

    ©2009-2025 Movatter.jp