Giter Site home page Giter Site logo

react-pull-to-refresh's Introduction

Hi there ๐Ÿ‘‹, I'm Carlos Li

  • ๐Ÿ”ญ Iโ€™m currently working on NextDrive
  • ๐Ÿค” Iโ€™m looking for help with PS5 buying (done ๐ŸŽ‰)
  • โ™ ๏ธ Mainly use Kotlin (Springboot) > Dart (Flutter ) > Typescript (React > Vue > Nest js)

Anurag's GitHub stats

react-pull-to-refresh's People

Contributors

dependabot[bot] avatar devchrisho avatar echoulen avatar ephys avatar jbeuckm avatar xepozz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

react-pull-to-refresh's Issues

Remove Arrow Icon in PullDownContent and ReleaseContent

Hi, I want to remove arrow icon in PullDownContent and ReleaseContent component. Can I create PR?

I think maybe the correction will be like this

interface PullDownContentProps {
  height?: string
  background?: any
  label?: string
  disabled?: boolean
}

export const ReleaseContent: React.SFC<ReleaseContentProps> = ({
  height = '200px',
  background = 'none',
  label = 'Release to refresh'
  disabled = false
}) => (
  <div id="container">
    {disabled ? null : <div id="arrow"/>}
    <span>{label}</span>
  </div>
)

Pull to refresh area size

Hi,

For now, the area to trigger onRefresh callback has only 40px (PullToRefresh.js;71). I think it should be parameterized, to allow bigger draggable area. Can you add that possibility?

Thank you.

The containers have set height: 'auto' with no way to override

The two containers that are rendered in default state have their height property set to 'auto' which causes issues in display on children components.
IMO, there should be a way to override that property as well. Like, in my case I need it as '100%'.

onRefresh is not fired

I followed up example but my onRefresh function is not fired, I just used onRefresh={this.onRefresh}

React 18.0.0 typescript

I just updated to react 18. And from the docs it says that children prop need to be explicitly defined when listing props. I got the error below:

Type '{ children: (ReactNode | Element)[]; pullDownContent: Element; releaseContent: Element; refreshContent: Element; pullDownThreshold: number; onRefresh: () => Promise<...>; triggerHeight: number; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.
Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'.ts(2322)

Use React.FC instead of React.SFC due to removal in React v18

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts b/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts
index 5921dc8..28d6767 100644
--- a/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts
+++ b/node_modules/react-js-pull-to-refresh/dist/src/components/PullDownContent.d.ts
@@ -4,4 +4,4 @@ export interface PullDownContentProps {
     background?: any;
     label?: string;
 }
-export declare const PullDownContent: React.SFC<PullDownContentProps>;
+export declare const PullDownContent: React.FC<PullDownContentProps>;
diff --git a/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts b/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts
index c7e1b03..edf61b1 100644
--- a/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts
+++ b/node_modules/react-js-pull-to-refresh/dist/src/components/RefreshContent.d.ts
@@ -3,4 +3,4 @@ export interface RefreshContentProps {
     height?: string;
     background?: any;
 }
-export declare const RefreshContent: React.SFC<RefreshContentProps>;
+export declare const RefreshContent: React.FC<RefreshContentProps>;
diff --git a/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts b/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts
index 8310fbd..5c928a6 100644
--- a/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts
+++ b/node_modules/react-js-pull-to-refresh/dist/src/components/ReleaseContent.d.ts
@@ -4,4 +4,4 @@ export interface ReleaseContentProps {
     background?: any;
     label?: string;
 }
-export declare const ReleaseContent: React.SFC<ReleaseContentProps>;
+export declare const ReleaseContent: React.FC<ReleaseContentProps>;

This issue body was partially generated by patch-package.


the above diff is for the dist/, but the solution should be a matter of just find-replacing React.SFC with React.FC.

Support React Lower version ?

I tried a demo, Its works, but It didnt call onRefresh function when I add this module to my project used react 15.6.2. I wonder because of the version of React, Does this module support React and ReactDOM 15.6.2 :(

Initiate pull to refresh only when list top is reached.

The pull to refresh is initiated whenever user scrolls on the triggerHeight even when the user has not reached at the top of the list. Please suggest some way to initiate the pull to refresh only when the user has reached at the top of the list. In my case the scroll element is <body> itself.

console error when scroll

Intervention] Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
PullToRefresh.onTouchMove @ PullToRefresh.js:144

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.