-
Notifications
You must be signed in to change notification settings - Fork 430
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
better optimizeForInsertDeleteAnimations and fix stableId collision #479
base: master
Are you sure you want to change the base?
Conversation
@LVBK @naqvitalha when this will be avaliable for use? Struggling with stable id collision issue. |
This is improtant fix, which is removing issue with stable ids, any plan to merge this? |
I totally agree. Its great to have an itemAnimator and an optimizeForInsertDelete functionality but if the stableId issue has not been resolved yet then we cant animate inserts correctly. A little guidance on when/if this is going to be merged would be greatly appreciated. |
Just to be clear - this is an issue of the itemAnimator for inserting/deleting failing to work once scrolling is enacted. |
@naqvitalha any plans to merge this? |
Any updates? |
This PR try to prevent RLV recycler too hard.
I try to use RLV and react-native-reanimated (Transitioning.View) for cool list animation (fade in, fade out, move)
But original RLV with optimizeForInsertDeleteAnimations not help 100%
When new item with new stableId come in.
Sometimes, RLV try to recycle with old render key so animation is Transition.Change, not Transition.In
So, my core idea. every time dataSource change. I will clear recyclePool. It will prevent reuse old render key,
new item will mount in (not update). It also help stableId collision.
DataProvider.cloneWithRows with 3rd optinal parameter optimizeForInsertAtBottomAnimation = true will try to _requiresDataChangeHandling when dataSource have something new item added to bottom of RLV (load more)
So _requiresDataChangeHandling = true will trigger VirtualRenderer.handleDataSetChange and prevent recycle items at top of RLV (Prevent top down move animation).
Now i'm happy with RLV and react-native-reanimated and goodbye Flatlist :)