报错:
Warning: [react-router] You cannot change <Router routes>; it will be ignored
原因是redux控制的数据发生改变了。每次都要重新渲染路由,
解决办法
在路由组件的生命周期shouldComponentUpdate里return false;就ok了
如下:(我这里注释了。把注释打开就好啦)
报错:
Warning: [react-router] You cannot change <Router routes>; it will be ignored
原因是redux控制的数据发生改变了。每次都要重新渲染路由,
解决办法
在路由组件的生命周期shouldComponentUpdate里return false;就ok了
如下:(我这里注释了。把注释打开就好啦)
转载于:https://my.oschina.net/pengpengpengone/blog/850119