示例代码
mines[i] = (
<p key = {i} ref = {i}></p>
);
.....
render(
return(
{mines}
)
)
此时,当刚刚渲染上去的时候,会提示报错
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.
请问怎么解决问题。。