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

React components support? #85

Open
mmarzullotv opened this issue Jun 23, 2023 · 1 comment
Open

React components support? #85

mmarzullotv opened this issue Jun 23, 2023 · 1 comment

Comments

@mmarzullotv
Copy link

mmarzullotv commented Jun 23, 2023

Hey guys, I need to create a specific custom Layout UI for the PiP window with React custom components, along with their business logic from hooks, state control and their styles. But I can't seem to find a proper way to do it. Is this even supported by now?

When I tried to move a button element wrapper from parent document to children window, that had event listeners attached to it such as onClick, the event got lost in the process. All the logic behind it as well for like switching visibility or controlled rendering based on some component state. It even replaced it for "null" for a different state rendering in the button. (Simple "Play" | "Pause" button element switching)

Any help related to this matter would be greatly appreciated. Keep up the good work!

@egm0121
Copy link

egm0121 commented Jul 24, 2023

you can use defintely render react components from your react app inside a PiP window by using a react portal, see: https://react.dev/reference/react-dom/createPortal

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

No branches or pull requests

2 participants