better optimizeForInsertDeleteAnimations and fix stableId collision#479
Open
LVBK wants to merge 11 commits intoFlipkart:masterfrom
Open
better optimizeForInsertDeleteAnimations and fix stableId collision#479LVBK wants to merge 11 commits intoFlipkart:masterfrom
LVBK wants to merge 11 commits intoFlipkart:masterfrom
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 :)