TypeError: Cannot read property '_currentElement' of null
See original GitHub issueFrom maintainers: if you have this problem, please see the explanation in https://github.com/facebook/react/issues/6895#issuecomment-281405036.
Test case: jsFiddle
The error is in this function, internalInstance is null.
/**
* Releases any resources allocated by `mountComponent`.
*
* @final
* @internal
*/
unmountComponent: function(internalInstance) {
ReactRef.detachRefs(internalInstance, internalInstance._currentElement);
internalInstance.unmountComponent();
}
I managed to “fix” the bug by simply checking if internal state is not null but that requires modifying react. Other mentions of this bug are listed below.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:32 (9 by maintainers)
Top Results From Across the Web
Cannot read property '_currentElement' of null - Stack Overflow
When data reloads and chronics is an array, react is able to call the render method successfully this time; but when it tries...
Read more >Cannot read property '_currentElement' of null-Reactjs
Coding example for the question React: Uncaught TypeError: Cannot read property '_currentElement' of null-Reactjs.
Read more >Uncaught (in promise) TypeError: Cannot read property ...
“Uncaught (in promise) TypeError: Cannot read property '_currentElement' of null” is published by Yaniv Aharon.
Read more >Uncaught TypeError: Cannot read property '_current...
Re: Uncaught TypeError: Cannot read property '_currentElement' of null ... Nope, I'm not trying to select more than one folder at a time....
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
This will result in Uncaught TypeError: Cannot read property 'value' of null . The reason will be that the element with id input...
Read more >
Top Related Medium Post
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rossPatton in chrome you can activate
pause on exception
and track down which component path is breaking.Almost always from rendering code throwing an error and preventing the render from completing.
Tracking down these errors is so killing productivity. I don’t even know which component is causing this. @blairanderson How do I get a proper error message? What do you mean by “force render at the top”? Is there anything I could wrap in a try/catch to get to the cause of the error?