I\'m trying to measure a view using a ref, but the width returned is 0 despite the fact that I see the view displayed on the screen (and it\'s far
To measure view size, no need to use ref at all. You can get it from nativeEvent passed by onLayout.
measureView(event: Object) {
console.log(`*** event: ${JSON.stringify(event.nativeEvent)}`);
// you'll get something like this here:
// {"target":1105,"layout":{"y":0,"width":256,"x":32,"height":54.5}}
}
render() {
return (
{this.measureView(event)}} />
);
}