- Add
pullToRefresh
prop. - Remove
useZscroller
scrollerOptions
refreshControl
pullUpEnabled
pullUpRefreshing
pullUpOnRefresh
pullUpDistanceToRefresh
pullUpRenderer
props. - Remove
ListView.RefreshControl
components.
Note: 0.11.0 version has very big optimization, if you use useZscroller
/ListView.RefreshControl
before. You need to follow new usage.
Now useZscroller
scrollerOptions
refreshControl
these props no longer work. Use the web's native scroller instead of zscroller, using the PullToRefresh
component instead of the ListView.RefreshControl
component.
Upgrade example:
+ import { ListView, PullToRefresh } from 'antd-mobile';
<ListView
dataSource={this.state.dataSource}
- refreshControl={<RefreshControl
+ pullToRefresh={<PullToRefresh
refreshing={this.state.refreshing}
onRefresh={this.onRefresh}
- icon={this.renderCustomIcon()}
+ indicator={{ deactivate: '下拉' }}
/>}
/>
Note: we do not recommend using simulated scroller. But you can also use zscroller to simulate the implementation of rolling containers like bofore. You can use 'rmc-list-view/lib/Zscroller'(or archive it yourself) and the complete example is here: zscroller example.
The following props table is in the ListView.RefreshControl
before,
Properties | Descrition | Type | Default |
---|---|---|---|
icon | refresh indicator, include pull and release state |
react node | - |
loading | loading indicator | react node | - |
distanceToRefresh | distance to refresh | number | 25 |
onRefresh | required, Called when the view starts refreshing. | () => void | - |
refreshing | Whether the view should be indicating an active refresh | bool | false |
now just directly attach them in ListView
component, and they will still work like before. Upgrade example:
+ import Zscroller from 'rmc-list-view/lib/Zscroller';
<ListView
dataSource={this.state.dataSource}
- refreshControl={<RefreshControl
- refreshing={this.state.refreshing}
- onRefresh={this.onRefresh}
- icon={this.renderCustomIcon()}
- />}
+ renderScrollComponent={props => <Zscroller {...props} />}
+ refreshControl
+ refreshing={this.state.refreshing}
+ onRefresh={this.onRefresh}
+ icon={this.renderCustomIcon()}
/>
The complete example is here: zscroller-pulldown example
- Rename
pullUpDistance
prop topullUpDistanceToRefresh
.
- Remove
stickyHeader
prop and react-sticky dependency, but you can also use react-sticky anduseBodyScroll
in listview by your self. (see demo)Because this feature is not commonly used and does not contain UI, so it is not suitable for integration.
- Add
renderSectionWrapper
prop, for more precise control.
- Change
RefreshControl
's inner dom className- from
${prefixCls}-ptr
to${prefixCls}-indicator
- from
${prefixCls}-ptr-icon
to${prefixCls}-indicator-icon-wrapper
- from
${prefixCls}-ptr-loading
to${prefixCls}-indicator-loading-wrapper
- from
- Remove
Promise
. - Support pull-up fully.
- Change
ref
fromstring
tofunction
.- ListView component's
refs.listviewscroll
change toListViewRef
- ScrollView component's
refs.ScrollView
change toScrollViewRef
- ScrollView component's
refs.InnerScrollView
change toInnerScrollViewRef
- ScrollView component's
refs.refreshControl
change toRefreshControlRef
- ListView component's