thmsgbrt / react-simple-pull-to-refresh

npm install react-simple-pull-to-refresh

Home Page:https://www.npmjs.com/package/react-simple-pull-to-refresh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Animation doesnt deactivate

CalvinJamesHeath opened this issue · comments

When I "Pull to Refresh" and no data comes in, the animation continues to load, even after isPullable becomes false. How I tell the component to stop the loading animation and pull back up?

The solution is to return a promise and resolve it.

<PullToRefresh
onRefresh={this.refresh} 
//more props
/>
refresh = () => {
return new Promise((res) => {
//your code
res(true)	// depending on your response.
});
}