Skip to content

Bug: Unable to use unmountComponentAtNode with unstable_createRoot #21441

Closed
@Sawtaytoes

Description

@Sawtaytoes

When calling unmountComponentAtNode(document.getElementById('react-root')), it returns false.

This would normally happen because I'm trying to unmount something that's not a React node, but that's not the case.

I'm using unstable_createRoot. If I use render instead, it works fine.

React version: 0.0.0-experimental-79740da4c

Steps To Reproduce

  1. Render component with unstable_createRoot.
  2. Try to unmount the app with unmountComponentAtNode.

Link to code example: https://codesandbox.io/s/epic-leftpad-ih6ts?file=/src/index.js

The current behavior

Doesn't unmount the root React component.

The expected behavior

Should unmount the root React component.

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