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 6 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?

@hirbod
Copy link
Contributor

hirbod commented Nov 21, 2024

Common guys, please just merge this already! 8th of July!

@hirbod
Copy link
Contributor

hirbod commented Nov 21, 2024

@naqvitalha please, merge some of these quality PRs and cut a release. We're playing cat & mouse with patching

@rklf
Copy link

rklf commented Dec 31, 2024

any update?

@favazpa
Copy link

favazpa commented Feb 18, 2025

will this work now?.Any comments?

@hirbod
Copy link
Contributor

hirbod commented Feb 18, 2025

@favazpa we gave up with FlashList and are using Legendlist now. It's also up so 20% faster in our tests and has proper support. https://github.com/LegendApp/legend-list

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.

7 participants