在控件声明 ref 报错
eg.
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 (details: https://fb.me/react-refs-must-have-owner).
求解答 !
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
没代码谁知道你是怎么用的。
警告的意思是你只能对react组件添加ref,而且在生命周期render之前,也就是组件还没有被创建之前添加ref,在render及之后的生命周期可以调用到ref
你添加ref的标签不是在render中创建的吗?