I am styling an Image component with flexbox to be in the center of the screen which works pretty well. Now I want a second Image component to be d
If you use function components and don't want to use a forwardRef to measure your component's absolute layout, you can get a reference to it from the LayoutChangeEvent in the onLayout callback.
This way, you can get the absolute position of the element:
{
event.target.measure(
(x, y, width, height, pageX, pageX) => {
doSomethingWithAbsolutePosition({
x: x + pageX,
y: y + pageY,
});
},
);
}}
/>
Tested with React Native 0.63.3.