Ant-design-mobile: PullToRefresh ts开发声明和文档没有对应,看其它库5天前 提交了 代码 请问下什么时候发布

Created on 8 Apr 2019  ·  2Comments  ·  Source: ant-design/ant-design-mobile

  • [ ] I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://github.com/react-component/m-pull-to-refresh

Steps to reproduce

文档和实际声明类型没有对应上

What is expected?

normal

What is actually happening?

Type '{ damping: number; refreshing: boolean | undefined; onRefresh: () => void; }' is missing the following properties from type 'Pick & Readonly<{ children?: ReactNode; }>, "onRefresh" | "refreshing" | "children" | "style" | "className" | "getScrollContainer" | "direction" | "distanceToRefresh" | "indicator" | "damping">': getScrollContainer, direction, distanceToRefresh, indicator TS2739

| Environment | Info |
|---|---|
| antd | 2.2.6 |
| React | latest |
| System | windows |
| Browser | chrome |


https://github.com/react-component/m-pull-to-refresh

Most helpful comment

pullToRefresh={
//选择容器
getScrollContainer={() => {
return ''
}}
direction={'down'} //刷新方式,默认为下拉
distanceToRefresh={window.devicePixelRatio * 25} //下拉多少距离刷新
refreshing={this.state.refreshing} //是否在刷新状态
onRefresh={this.onRefresh} //视图刷新时调用函数
damping={100} //能往下拉的距离
indicator={{
//指示配置
activate: '释放立即刷新',
deactivate: '下拉刷新',
release: '您的货物来啦...',
finish: '请开始您的表演吧'
}}
/>
}

All 2 comments

我也有相同的问题,请问一下,解决了吗??
用ts的时候,加上
pullToRefresh={
refreshing={this.state.refreshing}
onRefresh={this.onRefresh}
/>
}
就会报错

pullToRefresh={
//选择容器
getScrollContainer={() => {
return ''
}}
direction={'down'} //刷新方式,默认为下拉
distanceToRefresh={window.devicePixelRatio * 25} //下拉多少距离刷新
refreshing={this.state.refreshing} //是否在刷新状态
onRefresh={this.onRefresh} //视图刷新时调用函数
damping={100} //能往下拉的距离
indicator={{
//指示配置
activate: '释放立即刷新',
deactivate: '下拉刷新',
release: '您的货物来啦...',
finish: '请开始您的表演吧'
}}
/>
}

Was this page helpful?
0 / 5 - 0 ratings