thmsgbrt / react-simple-pull-to-refresh

npm install react-simple-pull-to-refresh

Home Page:https://www.npmjs.com/package/react-simple-pull-to-refresh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fetchMoreTresholdBreached

javaxiu opened this issue · comments

i think this should be a useRef ,

let pullToRefreshThresholdBreached: boolean = false;

because when dragging is happening, something like loading state would change the children props, which will cause this FunctionComponent re-call, then, this fetchMoreTresholdBreached flag would be false again, in tihs situation, here

var onScroll = function (e) {
    /**
         * Check if component has already called onFetchMore
         */
    if (fetchMoreTresholdBreached) return;

it may not work as expected