question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PullToRefresh type error

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.6

Environment

mac 10.14.1, chrome 70

Reproduction link

https://github.com/jkvim/WLM-TypeScript-React-Starter

Steps to reproduce

复现代码

<PullToRefresh
  damping={60}
  style={{
    height: this.state.height,
    overflow: 'auto',
  }}
  indicator={this.state.down ? {} : { deactivate: '上拉可以刷新' }}
  direction={this.state.down ? 'down' : 'up'}
  refreshing={this.state.refreshing}
  onRefresh={this.handleRefresh}
>

What is expected?

如果没有传 getScrollContainer 或者 distanceToRefresh 则使用默认值,ts 类型检查没有报错

What is actually happening?

如果没有传 getScrollContainer 或者 distanceToRefresh, 都会报错,因为 rmc-pull-to-refresh 定义的类型是必传的

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
liangzai92commented, Feb 24, 2020

在vscode里,command+鼠标顺着点进去,就找到interface了,在rmc-pull-to-refresh/lib/PropsType.d.ts里写的清清楚楚,一目了然。

export interface Indicator {
    activate?: React.ReactNode;
    deactivate?: React.ReactNode;
    release?: React.ReactNode;
    finish?: React.ReactNode;
}
export interface PropsType {
    getScrollContainer: () => React.ReactNode;
    direction: 'down' | 'up';
    refreshing?: boolean;
    distanceToRefresh: number;
    onRefresh: () => void;
    indicator: Indicator;
    prefixCls?: string;
    className?: string;
    style?: React.CSSProperties;
    damping: number;
}
1reaction
franckXucommented, Feb 22, 2019

遇到同样的问题,我暂时用下面来代码先把它们声明,来解决的

    getScrollContainer={() => undefined}
     distanceToRefresh={25}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Pull to refresh throwing this error - ios - Stack Overflow
I'm trying to implement pull to refresh in my cloud kit note app but I am getting the following error when I pull...
Read more >
SAP Asset Manager 2110 (MDK 6.X) : Custom Branded client ...
Based on the error, it appears that your environment is using Java ... on object of type org.gradle.api.internal.artifacts.dsl.dependencies.
Read more >
pulltorefreshjs - npm
A small, but powerful Javascript library crafted to power your webapp's pull to refresh feature. No markup needed, highly customizable and ...
Read more >
elm-pull-to-refresh 1.3.1 - Elm Packages
First you need to add pull to refresh to your messages and your model. import PullToRefresh type Msg = PullToRefreshMsg PullToRefresh.Msg type alias...
Read more >
pull_to_refresh | Flutter Package - Pub.dev
For the first type of mechanism, slivers are taken out of the system "illegally". ... Demonstrate another wrong doing,put ScrollView in another widget....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found