Skip to content
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

Review recycler issue inside the pager #819

Open
troZee opened this issue Apr 24, 2024 · 3 comments
Open

Review recycler issue inside the pager #819

troZee opened this issue Apr 24, 2024 · 3 comments
Assignees
Labels

Comments

@troZee
Copy link
Member

troZee commented Apr 24, 2024

There might be an issue inside the pagerview. Please checkout the below link:

facebook/react-native#42732

@troZee troZee added the fabric label Apr 24, 2024
@cipolleschi
Copy link
Contributor

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!

@troZee
Copy link
Member Author

troZee commented Jun 25, 2024

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?

@cipolleschi
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants