Modal transparency / ReactNativeIsland in 3rd party components #14213
austinhallock
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just upgraded to 0.76.3 and am very close to having our RNW paper app fully migrated over :)
For context, I'm working on a browser built for creators/livestreamers. Most of the UI is RNW, but the web viewport itself is a Chromium HWND that I need to overlay certain UI elements on top of.
My old implementation in video below won't work for obvious reasons (RN HWND is below Chromium HWND), so I need to render popovers into a separate HWND.
2024-12-17.12-13-08.mp4
The new
<Modal />
seems great for this (renders on top of Chromium HWND), but not quite there for my use-case. The main limitations right now being I don't seem to be able to set a custom position, and I didn't see an option to specify what happens when the "backdrop" is clicked or hovered into (ie being able to close the modal).The easiest workaround would be to have
<Modal />
support transparency and the ability to cover the entire screen - ie thetransparency
andpresentationStyle
props from https://reactnative.dev/docs/modal. Then I could handle positioning and backdrop behavior on my own.In the meantime (trying to get this out as soon as possible) I've been trying to build my own implementation of a Modal/Popover, but haven't been able to get that to fully work. Will keep trying since this is my last blocker. There was a recent commit that I thought would let me do this, but I haven't had luck yet.
I also plan on using a similar implementation (3rd party component ReactNativeIsland) to support multiple app windows within the same React Native instance.
Here's the rough code I'm trying out for the popover
I can get it to render in the new HWND if I use
ReactNativeIsland(view.Compositor())
(without passing in context and view). However, it's not interactive and still crashes if I dynamically add a new nested child on the tsx side (maybe because I have to use RootVisual since InternalRootVisual isn't exposed to 3rd party components)With all 3 params to ReactNativeIsland, it'll always crash, with a non-obvious (to me) error/stack - it traces back to Start(), so something in the core loop
If y'all have an example of a 3rd party component that renders React elements into a separate HWND, or some guidance let me know <3
call_stack.txt
Beta Was this translation helpful? Give feedback.
All reactions