Skip to content

ModalPortal not being cleaned up after componentWillReceiveProps #531

@B-Reif

Description

@B-Reif

Summary:

In my codebase, react-modal leaves behind its current ModalPortal element after receiving new props. It creates a new portal with the new data as expected, but it does not clean up the old ModalPortal element.

Steps to reproduce:

I've tried to reproduce the behavior in a Codepen and in a separate demo app, but I couldn't reproduce the issue. I only encounter the issue in an (unfortunately closed-source) application I'm developing.

Expected behavior:

Only one ModalPortal should exist. ModalPortal elements should not be left behind.

Additional notes:

I was encountering this issue both before and after the 3.0.0 release.

I assume this issue may be somehow external to react-modal, since I can't reproduce it elsewhere. But I have no idea how my application environment could be getting in react-modal's way of removing its portal, and I'm running out of ideas.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions