试图将ref设置为在组件方法中使用它,但未定义。如果我将ref定义移到AutoSizer之外,那么它将正常工作。
<div ref='refOK'>
this ref CAN be access in component's method
</div>
<AutoSizer>
{({ height, width }) =>
<div ref='refNotOK'>
this ref CANNOTbe access in component's method
</div>
}
</AutoSizer>