Need Example of onLayoutMeasured Usage
Closed this issue · 1 comments
xelmich commented
Is there any example about how to use onLayoutMeasured ?
shahnawaz commented
Hi @xelmich ,
You can do one of the following based on your requirement:
// Example 1 (usage in functional component)
<BarcodeMask width={300} height={100} onLayoutMeasured={yourFunction} />
// Example 2 (as an IIFE)
<BarcodeMask width={300} height={100} onLayoutMeasured={nativeEvent => yourFunction(nativeEvent)} />
// Example 3 (usage in class component)
<BarcodeMask width={300} height={100} onLayoutMeasured={this.yourFunction} />
// nativeEvent structure
{
target: number,
layout: { height: number, width: number, x: number, y: number}
}
I will add these examples in Readme.
Thanks