-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: Ensure that SlotFill does not use portals in React Native #29631
Conversation
@hypest, @chipsnyder, or @mchowning. I'm working on branching between the web and mobile for SlotFill so we could ensure that we never use React portals with React Native. Can you point me to the document that explains how to test changes with the mobile app? |
export { Fill, Provider }; | ||
|
||
export function Slot( props ) { | ||
return <BaseSlot { ...omit( props, 'bubblesVirtually' ) } />; |
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.
This needs more thinking. The first step could be to simply throw an error when the version that bubbles virtually is used. There are some differences between those two APIs that need to be bridged first. I would prefer to tackle it in its own PR.
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.
I don't think we should throw an error personally as this will allow us to have the same consumer code for mobile and web.
Size Change: -142 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
Thanks for reaching out @gziolo ! The starting point for mobile documentation is here, and that includes links to more detailed instructions for building the app on mobile. There may be gaps in the documentation for someone coming from the web side of things, so let me know if you run into any problems or find any areas we could improve our documentation. |
Description
This is the first step in refactoring of SlotFill implementation. The goal is to start using the version with React portals on the web. It's now enabled on a case-by-case basis with the
bubblesVirtually
prop. React portals aren't supported for React Native, so we aim to leave the old implementation there and ensure it never uses the unsupported version. As part of this PR, I included refactorings that try to bring the same structure to both implementations to make it simpler to reason about further steps.The only open question is whether we should throw an error when the
bubblesVirtually
prop set totrue
is passed in the React Native app. It could be useful as a temporary approach because there are some subtle differences in how SlotFill works when thebubblesVirtually
prop is set to a different value. It should be addressed separately though.How has this been tested?
I ensured that all tests pass.
I tested block toolbars and inspector controls on both the web and in the mobile app. For the mobile app, I used the instructions shared #29631 (comment) by @mchowning.
Screenshots
Types of changes
Refactoring towards better cross-platform support.
Checklist: