-
-
Notifications
You must be signed in to change notification settings - Fork 532
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(Android): incorrect childCount in removeViewAt when using flatlist on fabric #2307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's an ugly workaround but let's stick with it for now.
Hello @kkafar, are you going to create a release soon with this fix? Thanks |
Planning a stable 3.35.0 in the beginning of the next week. But don't hold me to it, it will be ready when it will be ready (Cyberpunk vibes unintended) |
…t on fabric (software-mansion#2307) ## Description This PR intents to fix the crash when navigating back from a screen with FlatList on the new architecture. The crash was caused by miscalculated `childCount` of the list. Earlier on I found out that setting the [removeClippedSubviews](https://reactnative.dev/docs/flatlist#removeclippedsubviews) option to false (defaults to true on Android) in the FlatList fixes the problem. This PR is rather a quick fix with an extra condition, that adds simple views in place of the miscalculated ones in `startTransitionRecursive` function if there's a FlatList with `removeClippedSubviews` option set. Fixes software-mansion#2282. ## Changes - added `Test2282.tsx` repro - added extra condition in `startTransitionRecursive` function <!-- ## Screenshots / GIFs Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. ### Before ### After --> ## Test code and steps to reproduce - added `Test2282.tsx` repro ## Checklist - [x] Ensured that CI passes
…t on fabric (#2307) This PR intents to fix the crash when navigating back from a screen with FlatList on the new architecture. The crash was caused by miscalculated `childCount` of the list. Earlier on I found out that setting the [removeClippedSubviews](https://reactnative.dev/docs/flatlist#removeclippedsubviews) option to false (defaults to true on Android) in the FlatList fixes the problem. This PR is rather a quick fix with an extra condition, that adds simple views in place of the miscalculated ones in `startTransitionRecursive` function if there's a FlatList with `removeClippedSubviews` option set. Fixes #2282. - added `Test2282.tsx` repro - added extra condition in `startTransitionRecursive` function <!-- Here you can add screenshots / GIFs documenting your change. You can add before / after section if you're changing some behavior. --> - added `Test2282.tsx` repro - [x] Ensured that CI passes (cherry picked from commit c47ad84)
Description
This PR intents to fix the crash when navigating back from a screen with FlatList on the new architecture. The crash was caused by miscalculated
childCount
of the list.Earlier on I found out that setting the removeClippedSubviews option to false (defaults to true on Android) in the FlatList fixes the problem.
This PR is rather a quick fix with an extra condition, that adds simple views in place of the miscalculated ones in
startTransitionRecursive
function if there's a FlatList withremoveClippedSubviews
option set.Fixes #2282.
Changes
Test2282.tsx
reprostartTransitionRecursive
functionTest code and steps to reproduce
Test2282.tsx
reproChecklist