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 16 Portals + iframes #77

Closed
raycohen opened this issue Jan 17, 2018 · 3 comments
Closed

react 16 Portals + iframes #77

raycohen opened this issue Jan 17, 2018 · 3 comments

Comments

@raycohen
Copy link
Contributor

using react 16 portals, we are rendering part of our component tree into an iframe. We ran into the issue where the Media components in that part of the tree are referencing the parent window when we want it to reference the iframe.

Would you accept a PR to allow specifying the window object to be used (as an optional prop) for the matchMedia call, in our case sometimes an iframe's contentWindow?

@mjackson
Copy link
Member

Mmm, yes, that sounds like a good idea.

Can we make it automatic? For example, auto-detect if we are in an iframe and use that? I can't think of any situation where you'd render a <Media> in an iframe and want the media query registered on its parent window.

@tonyjmnz
Copy link

Related PR #78

@mjackson
Copy link
Member

Fixed in #78

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

No branches or pull requests

3 participants