Skip to content

Fix inverted FlatList#5295

Merged
bartlomiejbloniarz merged 3 commits into
mainfrom
@bartlomiejbloniarz/fix-inverted-flatlist
Oct 30, 2023
Merged

Fix inverted FlatList#5295
bartlomiejbloniarz merged 3 commits into
mainfrom
@bartlomiejbloniarz/fix-inverted-flatlist

Conversation

@bartlomiejbloniarz
Copy link
Copy Markdown
Contributor

@bartlomiejbloniarz bartlomiejbloniarz commented Oct 23, 2023

Summary

This PR changes how reanimated treats inverted FlatLists. In #3765 our implementation was changed to mimic the react-native behavior by assigning a special style that reverts the cell inversion (inverted FlatList flips the entire view and then flips back every cell). In react-native@0.72.4 the inversion style was changed on android due to some performance issues. That change combined with our implementation was causing the cell to remain inverted on android (since both styles were being applied). This PR changes our implementation to instead allow the CellRendererComponent to receive a style prop, making react solely responsible for the cell inversion.

Test plan

Check whether the Inverted FlatList Example behaves properly on android.
I tested the example on all rn versions from rn@0.69

@bartlomiejbloniarz bartlomiejbloniarz marked this pull request as ready for review October 23, 2023 10:12
Comment thread src/reanimated2/component/FlatList.tsx Outdated
Comment thread src/reanimated2/component/FlatList.tsx
Comment thread src/reanimated2/component/FlatList.tsx
Copy link
Copy Markdown
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more thinks, leave a note in PR description that you check if it works fine for older RN versions too

Comment thread src/reanimated2/component/FlatList.tsx Outdated
@tjzel tjzel self-requested a review October 27, 2023 15:00
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.

3 participants