-
-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Description
When using LegendList
with a conditional ListFooterComponent
:
<LegendList
...
onEndReached={onEndReached}
ListFooterComponent={isLoadingNext ? <LoadingNextFallback /> : null}
/>
The onEndReached
callback fails to fire when isLoadingNext
is false
and ListFooterComponent
is null
. This pattern is commonly used to show a loading skeleton only while fetching the next page of results.
Expected Behavior
onEndReached
should trigger based on scroll position regardless of whether ListFooterComponent
is null
.
Actual Behavior
onEndReached
is never called unless ListFooterComponent
is a non-null element, which breaks infinite scroll behavior when using the typical conditional rendering pattern.
Steps to Reproduce
- Pass an
onEndReached
handler. - Use a conditional footer:
ListFooterComponent={isLoadingNext ? <LoadingNextFallback /> : null}
- Scroll to the end — note that onEndReached does not fire.
Suggested Fix
Ensure onEndReached
triggers properly based on scroll position regardless of the presence or absence of ListFooterComponent
.
Temporary Workaround
Replace null
with an empty View
to preserve layout continuity:
VladyslavMartynov10 and dream11-atharva
Metadata
Metadata
Assignees
Labels
No labels