Unable to find node on an unmounted components always occurs

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.10.2

Environment

macos chrome 70.0.3538.67, react 16.6.0 react-dom 16.6.0

Reproduction link

https://ant.design/docs/react/introduce-cn

Steps to reproduce

We are using the <Button/> component not the <Wave/> component, but it seems the error occurs in Wave’s componentDidmount method. We switched from antd 3.8.4 to 3.9.3 to 3.10.2, but the problem still lurks

react-dom.development.js:55 Uncaught Error: Unable to find node on an unmounted component.
    at invariant (react-dom.development.js:55)
    at findCurrentFiberUsingSlowPath (react-dom.development.js:4161)
    at findCurrentHostFiber (react-dom.development.js:4269)
    at findHostInstanceWithWarning (react-dom.development.js:18296)
    at findDOMNode (react-dom.development.js:18774)
    at Wave.componentDidMount (wave.js:118)
    at commitLifeCycles (react-dom.development.js:14685)
    at commitAllLifeCycles (react-dom.development.js:15905)
    at HTMLUnknownElement.callCallback (react-dom.development.js:145)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:195)

What is expected?

This error should never happen

What is actually happening?

This error should never happen

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
schester44commented, Dec 26, 2018

It only occurs when the Menu component is nested inside of a Suspense component.

2reactions
zlv-thisFcommented, Dec 27, 2018

Thx a lot! @schester44 @ztplz, it does work!

in my project, nested routes is a bit more complicated , nested deep inner Switch still throw error as above mentioned, now i have changed React.suspense wrap all routes to something like:

image

image

now all work as expected in my project;

its high time i read the source code of React.Suspense and React.lazy !!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug: Uncaught Error: Unable to find node on an unmounted ...
Hi, I used react-sortable-tree package im my react project in component named Tree: import React, { Component } from "react"; import axios ...
Read more >
React 16: Error: Unable to find node on an unmounted ...
Based on the error message, I believe the error is happening when calling ReactDOM.findDOMNode(this) in the handleClickOutside(event) method.
Read more >
8 common React error messages and how to address them
React Hook has a missing dependency: 'XXX'. Either include it or remove the dependency array; Can't perform a React state update on an...
Read more >
“> Uncaught Error: Unable to find node on an unmounted ...
To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. ... an't perform a React state update on an unmounted ...
Read more >
Avoid React state update warnings on unmounted components
React raising a warning when you try to perform a state update on an unmounted component. React setState is used to update the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found