Open troZee opened 7 months ago
Yep, the problem here is that pager-view is using a view provided by fabric as content-view. That should not be done as UIPageViewController modifies the content view and, if then Fabric recycle it, it might serve a modified view to some other surface.
Instead of init
the pager view with a React Native view, please consider adding the React Native view as subview of the UIKit view, so that we do not risk to recycle the UIKit view.
I can share more details if needed!
Thank you @cipolleschi and @j-piasecki for checking this issue 🙏
I can share more details if needed!
So I have a question to clarify that. Do you mean to wrap every react native children view with UIView, so UIPageViewController will not interfere with react native children view?
From my exploration, there is this extension that defines an initWithView
, that is used here and here to create a ViewController where the root view is a RCTView.
The problem with this approach is that the root view of this ViewController, once set as a child of a UIPagerViewController, is modified by UIKit, setting some native properties that Fabric can't reset automatically, because it doesn't know that they have been changed.
Instead of doing that, we should create a regular ViewController and set the RCTView as a subview of the default view of the view controller. So that UIKit does not modify the view coming from fabric.
Does it make more sense?
There might be an issue inside the pagerview. Please checkout the below link:
https://github.com/facebook/react-native/issues/42732