New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@patlux/react-pull-to-refresh

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@patlux/react-pull-to-refresh

A React component for pull to refresh on the web.

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-pull-to-refresh

npm install react-pull-to-refresh -S

A pull to refresh component for the web.

Based on Andy Peatling's Pull to Refresh for the Web

Demo GIF

Usage

Your refresh handler function takes in resolve and reject to tell the PullToRefresh component when it's finished.

handleRefresh(resolve, reject) {
  // do some async code here
  if (success) {
    resolve();
  } else {
    reject();
  }
}

Where you want to render the component:

<ReactPullToRefresh
  onRefresh={this.handleRefresh}
  className="your-own-class-if-you-want"
  style={{
    textAlign: 'center'
  }}>
  <h3>Pull down to refresh</h3>
  <div>{items}</div>
  <div>etc.</div>
</ReactPullToRefresh>

CSS

Use the CSS from the example or from here as a starting point.

All props

PropTypes

  • onRefresh: PropTypes.func.isRequired
  • icon: PropTypes.element
    • default:
    <span className="genericon genericon-next"></span>
    
  • loading: PropTypes.element
    • default:
    <div className="loading">
      <span className="loading-ptr-1"></span>
      <span className="loading-ptr-2"></span>
      <span className="loading-ptr-3"></span>
    </div>
    
  • disabled: PropTypes.bool
  • className: PropTypes.string
  • style: PropTypes.object
  • distanceToRefresh: PropTypes.number
    • default: 70
  • resistance: PropTypes.number
    • default: 2.5
  • hammerOptions: PropTypes.object

Thanks

Andy Peatling

Keywords

FAQs

Package last updated on 15 Nov 2018

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