-
-
Notifications
You must be signed in to change notification settings - Fork 541
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: do not add views on transition to ViewPager2 #2527
Conversation
Hey, while this is good patch for your particular case we won't go this way. Here I'll patch this in a bit different manner |
@kkafar thanks for making the effort for fixing the cause of the problem, much appreciated. I will of course leave it to your discretion, but I would argue that it will impact many developers before it lands in core and they manage to update. So while this is not ideal, as temporary measure it might work to fix issues with pager view and expo video. It's hard to narrow down this issue on Fabric because the stacktrace is not very clear there. |
If you have capacity to patch your project with #2531 and let me know whether it resolves it issue it would be great. |
…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
I'll close the PR as it should be superseded and the issue should be handled by #2531 Thank you for investigating this! In case something still does not work for you let me know |
Description
There is an issue in
react-native-pager-view
that happens when you unmount a screen with ViewPager2 in it. As you cannot add views toViewPager2
directly. This change omits it. I can reproduce it on paper but Fabric seems also to be affected.Fixes callstack/react-native-pager-view#906.
Changes
Test code and steps to reproduce
The repro is linked in the original issue.
Checklist