Skip to content

createPortal cannot have a nullable target #204

@mattlo

Description

@mattlo

I've run into rare situations where createPortal used on two lines is using null target values. https://github.com/ryanseddon/react-frame-component/blob/master/src/Frame.jsx#L118

This, in turn, creates a "Target container is not a DOM element." exception.

This was reported in the past here: #131

Regardless of the related bugs from my sentry report, at the bare minimum, the argument should be checked if it's actually null or not. This is more easily noticeable in TypeScript.

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