react-pull-to-refresh
npm install react-pull2refresh -S
A pull to refresh component for the web.
Based on Andy Peatling's Pull to Refresh for the Web
Usage
Your refresh handler function takes in resolve
and reject
to tell the PullToRefresh component when it's finished.
{ // do some async code here if success ; else ; }
Where you want to render the component:
Pull down to refresh {items} etc.
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:
- loading:
PropTypes.element
- default:
- disabled:
PropTypes.bool
- className:
PropTypes.string
- style:
PropTypes.object
- distanceToRefresh:
PropTypes.number
- default:
70
- default:
- resistance:
PropTypes.number
- default:
2.5
- default:
- hammerOptions:
PropTypes.object
Thanks
hack scroll issue
to enable proper scroll capablilty, add css as blow