React Uncaught Invariant Violation: ReactMount: Two valid but unequal nodes with

报错提示:

invariant.js:39 Uncaught Invariant Violation: ReactMount: 
Two valid but unequal nodes with the same `data-reactid`: .0.2.4.0.$117405.0

报错原因:

     由于你的React代码包含了双重点击事件或者,A标签里面嵌套了A标签或onClick事件

<a>
  <div></div>
  <a>来点击吧</a>
</a>

报错代码:

<Link to={`/reply-thread/`}>

  ......

  <Thumb onClick={function()} />
</Link>

 

解决方案:

  移除级联引起冒泡事件的函数。 



有疑问或技术交流,扫描公众号一起讨论学习。

更多React在线学习访问:http://each.sinaapp.com/react/index.html

猜你喜欢

转载自qiaolevip.iteye.com/blog/2297550