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

fix: trigger onViewableItemsChanged when data changes #1259

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

intergalacticspacehighway
Copy link

@intergalacticspacehighway intergalacticspacehighway commented Jul 8, 2024

Description

FlashList does not re-trigger onViewableItemsChanged callback if the data prop changes. This also varies from React Native's FlatList. The function name onViewableItemsChanged is such that it should trigger if data changes (because it can change the visible items). React Native's VirtualizedList uses a similar approach used in this PR to re-trigger the viewability state in didUpdate.

Fixes (issue #)
#566

Reviewers’ hat-rack 🎩

  • Test onViewableItemsChanged fires when data prop changes.

Screenshots or videos (if needed)

Checklist

@intergalacticspacehighway
Copy link
Author

I have signed the CLA!

@amer-kocan-sowalabs
Copy link

We are experiencing the same issue as described in this PR and, when applying these changes by @intergalacticspacehighway, it seems to resolve it for us.

@naqvitalha Are there any plans to merge this and release this properly?

@Fungusjuice
Copy link

any update?

@sadenisa
Copy link

any updates on this?

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

Successfully merging this pull request may close these issues.

4 participants