react-modal: Failed prop type: Invalid prop `appElement` supplied to `Modal`.

Currently, appElement is expected to be an instance of window.HTMLElement.

But, when the Modal is rendered inside an iframe, the iframe’s window.HTMLElement is a different instance causing the following warning:

Failed prop type: Invalid prop appElement supplied to Modal.

See: Codesandbox

What’s the best to workaround this?

About this issue

Most upvoted comments

Yeah…the project will need to have everything that react-modal uses to compile…I’ll upload a precompiled version in this branch.