[BUG] Render into iframe
See original GitHub issueWhen a motion.div
(or any motion
component) is rendered into an iframe, the following invariant fails:
invariant(ref.current instanceof Element, "No `ref` found. Ensure components created with `motion.custom` forward refs using `React.forwardRef`");
Although ref.current
is also an Element
, it’s an Element
from another window
. Thus it doesn’t belong to the same prototype chain as the one referenced in above codeinstanceof Element
.
A possible solution is to use ref.current.constructor.name
? Or remove the invariance?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Bug: Rendering content inside an iFrame using createPortal ...
I'm trying to render JSX content inside an iFrame using createPortal. It works fine in Edge, Chrome, but in Firefox the iframe body...
Read more >React-app renders an Iframe and it causes bug, How to delete ...
In the app, an Iframe is rendered in HTML and it gets some ridiciolus z-index value and covers whole the page.
Read more >React, Iframes, and a Back-Navigation Bug
In this post, we'll fix a bug where iframes in React interfere with your browser's back-navigation. Skip table of contents. Table of Contents....
Read more >HTML renderer can't render an iframe | Voters
When trying to open a page with HTML renderer that has an iframe, the app crashes to a red screen. https://forums.appgyver.com/t/error-in-html-renderer-while- ...
Read more >Best practices for React iframes - LogRocket Blog
When a resource is rendered in an iframe, it functions independently of the parent component where it is embedded. Therefore, neither the parent ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can this issue be reopened please?
@InventingWithMonster Any suggestions/directions for anyone interested in raising a PR for this?