0
私が割り当てたすべての参考文献のmeasure()
を取得したいと考えています。これは私が管理しようとしているものです:refを配列に入れることは可能ですか?
<View
ref="dropZone[]">
</View>
<View
ref="dropZone[]">
</View>
lets dropZones = []
for(let i=0; i < refs.length; i++){
this.refs[i].measure((ox, oy, width, height, px, py) => {
dropZones.push({x: px, y:py, height: height, width: width})
}
}
これを管理するにはどうすればよいでしょうか?
それは動作しますか?それが機能すれば - それはそうでなければ "最高"です。 – zerkms
私はちょうどこのように例を示すようにしていました。それは小道具で配列を宣言することも可能ですか? –
可能です - https://facebook.github.io/react/docs/refs-and-the-dom.html – zerkms