Closed NxRoot closed 4 years ago
Hey @preto89! This is the expected behavior here. Since the flag images are loaded using require
in resources/flags/index.js
, the getFlag
function returns the asset reference (which is a number). This is the same value that is returned by require
ing the image directly.
this.input.getFlag("gb") === require('react-native-phone-input/lib/resources/flags/images/gb.png')
You should be able to pass this value directly to Image.source
, or you can use resolveAssetSource
if you need to access the uri
, width
, or height
of the image. You can read more about how RN handles images in the docs.
getFlag always returns a number how am i supposed to use that as an image?
console.log(this.input.getFlag("gb"))
returns 79
<Image source={79} ????? how does this work