For Android I know I can use StatusBar.currentHeight
but I'm not sure how to do so for iOS.
The answer to how to retrieve the size in Swift(native) has already been answered but I need this in a react native app.
You can use React Navigation that already have support of iPhone X.
Even if you don't want use this library because of some reason - you still can read source code to copy implementation in your code