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.

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

阅读 6.9k
4 个回答

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

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

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

可能你渲染前后的dom结构不同了?

新手上路,请多包涵

LZ问题是怎么解决的

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题