question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property '_currentElement' of null

See original GitHub issue

From 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:closed
  • Created 8 years ago
  • Reactions:4
  • Comments:32 (9 by maintainers)

github_iconTop GitHub Comments

9reactions
blairandersoncommented, Apr 3, 2016

@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.

7reactions
tcurdtcommented, Jan 9, 2016

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?

Read more comments on GitHub >

github_iconTop 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 >

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 Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found