react-native
react-native copied to clipboard
0.14 required image cannot get width/height
Firstly, I love new the asset management strategy.
//before 0.14
var img = require('image!xxx');
img.width, img.height
var img = require('./img/abc.png');
//I see img is compiled index as integer type
So how can I get image width/height?
Find a way to handle this:
// for react native 0.14 +
var resolveAssetSource = require('resolveAssetSource');
var imgSrc = resolveAssetSource(require('./some.png'));
console.log(imgSrc.width, imgSrc.height);