admin管理员组文章数量:1327069
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
inobject._currentElement
isnull
. – 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
5 Answers
Reset to default 1Make 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
版权声明:本文标题:javascript - React: Uncaught TypeError: Cannot read property '_currentElement' of null - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742211831a2433852.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论