-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Draft] [WIP] Get Modal to host RN components in new hwnd #13500
base: main
Are you sure you want to change the base?
Conversation
vnext/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.cpp
Outdated
Show resolved
Hide resolved
vnext/Microsoft.ReactNative/Fabric/Composition/Modal/WindowsModalHostViewComponentView.h
Outdated
Show resolved
Hide resolved
m_rootVisual = reactNativeIsland.RootVisual().try_as<winrt::Microsoft::UI::Composition::ContainerVisual>(); | ||
|
||
// set ScaleFactor | ||
reactNativeIsland.ScaleFactor(GetDpiForWindow(m_hwnd) / 96.0f); |
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.
@acoates-ms UI is loading, thanks so much for the help!!
Another question the UI is not interactable yet, I'm assuming it's because I haven't set the ReactNativeIsland.ReactViewHost(), however should Modal share a ReactViewHost with the main application or create it's own?
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.
Hmm, if we dont have a ReactViewHost, then we shouldn't be using ReactNativeIsland. -- At least not in its current form. ReactNativeIsland is for hosting UI that is a react root view. We need something similar to host a ReactFragment.
Not sure what exactly the design for this should look like.
Maybe we create a ReactNativeFragmentIsland class that is similar to ReactNativeIsland, but takes a ComponentView instead of a ReactViewHost. Or we could try to add such a property to ReactNativeIsland.
The actual reason that the input isn't happening is that no-one is hooking up a CompositionEventHandler to your window, since ReactNativeIsland normally does that when the rootview is initialized.
Description
WIP do not merge in please! :)
Using for easy review of design discussions, currently builds and inputs UI! but UI is not interactable 😕 I'll clean up the actual code once it's doing something!
Microsoft Reviewers: Open in CodeFlow