admin管理员组

文章数量:1326620

I'm having problem rendering a route in React. All I see is the page before React does any rendering to it, and the following error.

Mainly, I'm having trouble figuring out which ponent/line is causing the error, if anyone can provide some insight I'd appreciate that. Thanks.

I'm having problem rendering a route in React. All I see is the page before React does any rendering to it, and the following error.

Mainly, I'm having trouble figuring out which ponent/line is causing the error, if anyone can provide some insight I'd appreciate that. Thanks.

Share Improve this question asked Aug 14, 2015 at 13:35 AngelaAngela 1,0741 gold badge12 silver badges23 bronze badges 3
  • 3 Without the relevant code there's not much we can do. Only thing is sure, object in object._currentElement is null. – Teemu Commented Aug 14, 2015 at 13:38
  • 1 Here is a bug writeup that is probably your issue: github./facebook/react/issues/4026 – JosiahDaniels Commented Aug 14, 2015 at 14:32
  • Any error you're getting apart from this, maybe some other issue is causing this? – Abhinav Singi Commented Oct 19, 2015 at 8:27
Add a ment  | 

5 Answers 5

Reset to default 1

Make sure you're importing all ponents your using inside your render() { ... } block.

This error can be thrown if you're trying to render a ponent that hasn't been properly imported or is returning undefined.

If this is a case you may also be seeing a related error Uncaught TypeError: inst.render is not a function.

I try to identifying which ponent is causing the issue by:

  • Replace jsx with simple <div>test</div> element by element
  • If I find an element / ponent causing it, I make sure it is impoted, then dig deeper.
  • Look at your diff and revert code / stash code

Best of luck!

I had such error when had multiple instances of React required. Is it the case for you?

I frequently see this after any ponent has let an uncaught exception out of its render() method. Only resolution we've found so far is refreshing the page.

本文标签: javascriptReact Uncaught TypeError Cannot read property 39currentElement39 of nullStack Overflow