mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 01:31:45 +00:00
When requiring in an image path (require('./path/to/image.png')), the require resolves to a number.
This number can be passed directly into the image source, e.g:
```javascript
const imageId = require('./path/to/image.png');
return <Image source={imageId} />;
```
I'm not sure if this has official documentation anywhere but this is how I've been rendering images for some time:
https://facebook.github.io/react-native/docs/image.html#source