Skip to content

a component is mounted twice #13626

@michael8090

Description

@michael8090

bug

What is the current behavior?

For the same component, componentDidMount is called multiple times, without calling componentWillUnmount , when using ReactDOM.unmountComponentAtNode .

You can use the link below to reproduce it:

https://codesandbox.io/s/x76mlw16rp

What is the expected behavior?

componentWillUnmount should be called before calling componentDidMount again.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

16.x

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