Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double call onEndReached/onStartReached function #14

Open
reeq-dev opened this issue May 5, 2021 · 1 comment
Open

Double call onEndReached/onStartReached function #14

reeq-dev opened this issue May 5, 2021 · 1 comment

Comments

@reeq-dev
Copy link

reeq-dev commented May 5, 2021

Hi. Thanks for such library, but i faced two issues. Ill create another "issue" to separate them later.
So the first as title says: every time i have double call for both end reached functions.
I have tried some blockers like "isLoading" with useState or useRef, and anyway i've got a double call.

onEndReached={() => fetchNextEvents('someParams')}
onStartReached={() => fetchPrevEvents('someParams')}
onEndReached={fetchNextEvents}
onStartReached={fetchPrevEvents}

const fetchPrevEvents = async (someParams = 'DEFAULT_PARAM') => {
    try {
        const events = await fetchEvents(someParams);
        ...
    } catch (err) {
      console.log('Error fetching prev events', err);
    }
};

IOS simulator - iPhone 11 - 14.4

"react-native": "0.64.0",
"react-native-bidirectional-infinite-scroll": "^0.3.3",
"@stream-io/flat-list-mvcp": "^0.10.1",
"react": "17.0.1",

@reeq-dev
Copy link
Author

reeq-dev commented May 7, 2021

Well, after some work around, the issue is dissapearing after setting prop bounces={false}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant