Skip to content

instanceOf(Element) doesn't work in iframe #3

Closed
@oliviertassinari

Description

@oliviertassinari

@merceyz I have noticed a warning with this demo https://material-ui.com/components/drawers/#responsive-drawer which lead my track down to:

case 'Element': {
// Nextjs: Element isn't defined on the server
return t.instanceOfNode("typeof Element === 'undefined' ? Object : Element");
}

instanceOf(Element) doesn't work with different documents, e.g. iframe: facebook/prop-types#240 (comment).

We were able to work around the problem in the Popper component with: https://github.com/mui-org/material-ui/blob/c1c66903b8cc3941d0e110f13f49122effdc0e47/packages/material-ui/src/Popper/Popper.js#L238.

Any idea on how we could best solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions