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

onEndReached function is not executed on reaching end of Flatlist #34

Open
klmadnan opened this issue May 13, 2024 · 0 comments
Open

onEndReached function is not executed on reaching end of Flatlist #34

klmadnan opened this issue May 13, 2024 · 0 comments

Comments

@klmadnan
Copy link

klmadnan commented May 13, 2024

I am using latest version of react-native ("0.73.5"). I wrap PullToRefresh component to my Flatlist to achieve custom view for refresh control.

Implementation:

<PullToRefresh
            header={<CustomPullToRefreshHeader refreshing={isRefreshing} onRefresh={onRefresh} />}
        >
            <FlatList
                data={modifiedData}
                showsVerticalScrollIndicator={false}
                style={[styles.flatList, style]}
                contentContainerStyle={[
                    {
                        rowGap: Metrics.scale(gapY || 0),
                        columnGap: Metrics.scale(gapX || 0),
                    },
                    props.horizontal && styles.contentContainerHorizontal,
                    !props.horizontal && styles.contentContainerVertical,
                ]}
                scrollEventThrottle={16}
                {...rest}
                {...(listEmptyText && {
                    ListEmptyComponent: () => (
                        <ListEmptyComponent
                            listEmptyText={listEmptyText}
                            isLoading={isLoading}
                            LoaderComponent={LoaderComponent}
                            waitingForSearch={searchingListOnly && storeIsEmpty}
                            listEmptySubText={listEmptySubText}
                            EmptyComponent={EmptyComponent}
                        />
                    ),
                })}
                ListHeaderComponent={ListHeaderComponent}
                ListFooterComponent={() =>
                    footerLoadingCondition || meta.isFetchingNextPage ? (
                        <LoaderComponent size="small" count={2} />
                    ) : null
                }
                onEndReached={fetchMore}
                onEndReachedThreshold={0.4}
            />
        </PullToRefresh>

now the issue is by wrapping PullToRefresh onEndReached listener stop working. If i remove PullToRefresh Wrapper then onEndReach function working perfectly.

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