Check out example codes for "xcode how to get aspect ratio of device". It will help you in understanding the concepts better.

Code Example 1

let deviceWidth = UIScreen.main.bounds.width * UIScreen.main.scale
let deviceHeight = UIScreen.main.bounds.height * UIScreen.main.scale
let testDeviceAspectRatio = deviceHeight / deviceWidth

Learn ReactJs, React Native from akashmittal.com