How to Measure Distance and Position Between the Camera and an Object in React Native?

In order to achieve the correct camera position relative to an object, I need information about the camera’s position and the distance between the object and the camera. Is there any ready-made library in React Native/Expo that measures such values?

You would need to use known values to estimate this. AFAIK no lib to do this in React. For example lets say you were trying to estimate how far away a box is from the camera.

If the box is a specific box with known width/height/depth etc you could estimate its 3D bounding box using something like YOLO3D, rotate it so perpendicular to camera and measure how many pixels wide it is, and from that pixel count you would know that it could only be that many pixels in width when it is x meters away from the camera to give you a rough idea of how far away it is.

At least that is my starting point I would do to make this.

If you want to know real world co-ordinates from your camera then that is much harder than just distance as you would need to know the cameras exact position, rotation etc in addition to some known measurement.