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

[Draft] [WIP] Get Modal to host RN components in new hwnd #13500

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

TatianaKapos
Copy link
Contributor

@TatianaKapos TatianaKapos commented Jul 25, 2024

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

m_rootVisual = reactNativeIsland.RootVisual().try_as<winrt::Microsoft::UI::Composition::ContainerVisual>();

// set ScaleFactor
reactNativeIsland.ScaleFactor(GetDpiForWindow(m_hwnd) / 96.0f);
Copy link
Contributor Author

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?

Copy link
Contributor

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.

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

Successfully merging this pull request may close these issues.

3 participants