标签:ted uncaught mat 参考 ror 没有 git 控制台 sid
1、控制台报错:
Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component‘s `render` method, or you have multiple copies of React loaded
Uncaught Error: removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might be removing a ref to a component that was not created inside a component‘s `render` method, or you have multiple copies of React loaded
如果检查了没有refs的错误,那么就有可能是你引入了多个react版本,我的项目使用的是yarn, yarn list react看下:
yarn list v1.1.0
├─ com1@1.0.5
│ └─ react@0.14.8
├─ comp2@0.0.4
│ └─ react@0.14.8
├─comp3@1.0.2
│ └─ react@0.14.8
├─ comp4@1.2.1
│ └─ react@0.14.8
├─ comp5@1.2.0
│ └─ react@0.14.8
└─ react@0.14.9
项目下面安装了react14.8 又安装了14.9
所以会有问题
参考https://github.com/callemall/material-ui/issues/6345
标签:ted uncaught mat 参考 ror 没有 git 控制台 sid
原文地址:http://www.cnblogs.com/YangqinCao/p/7685971.html