React.js redux 渲染错误?

查看:129
本文介绍了React.js redux 渲染错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

react-0.14.0.js:18745 Warning: render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.

页面是能正常渲染出来,但是为什么会出现这个错误?

解决方案

这个警告是在说你在重新渲染react组件中的子组件或者节点的时候原来的根节点被替换掉了,类似于你将

ReactDom.render(<App />, document.getElementById('a')

App 中的 children 发生了变化,这个时候你可能又调用了 ReactDOM.render 方法,查看你自己的代码确认下

这篇关于React.js redux 渲染错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆