Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Android): prevent crash when we can not insert any subviews into …
…child (#2531) ## Description Attempt to patch changes from #2495. It improved the situation in most of the cases but caused crashes in cases where we tried to insert subviews into viewgroups that have any kind of assertions on their child count, e.g. `NestedScrollView` or `ViewPager`. Fixes #2529 Supersedes #2527 ## Changes In this PR I do two things: * apply the workaround only to views that could actually have clipped subviews * catch any kind of exception thrown on view insertion; if one is thrown we stop to add subviews for given child ## Test code and steps to reproduce Test2282 works in both configurations (complex screen with nested flatlists + my simple reproduction of the issue) ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Updated documentation: <!-- For adding new props to native-stack --> - [ ] https://github.com/software-mansion/react-native-screens/blob/main/guides/GUIDE_FOR_LIBRARY_AUTHORS.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/native-stack/README.md - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/types.tsx - [ ] https://github.com/software-mansion/react-native-screens/blob/main/src/native-stack/types.tsx - [ ] Ensured that CI passes
- Loading branch information