Skip to content

When container is document, cleanup steps fails with "TypeError: Cannot read properties of null (reading 'removeChild')" #1329

Open
@quisido

Description

@quisido

Just opening this for tracking with the associated PR: #1330 .

When:

render(<Component />, { container: document });

(Untested: This bug may require that Component render a <body> element.)

Then:

TypeError: Cannot read properties of null (reading 'removeChild')

Because:

// pure.js
    if (container.parentNode === document.body) {
      document.body.removeChild(container);
    }

If we first check that document.body is not null, then this error will not occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions