0
有两种方法可以require
React Native中Image
组件的图像。当我使用`require`在React Native中加载图像时,它是否真的将图像加载到内存中?它何时会发布?
// 1. inline `require` (triggered when using)
const IconView =() =>
<Image source={require('./img/favicon.png')} />
// 2. define a variable for cache (triggered when loading)
const imageSource = require('./img/favicon.png')
const IconView =() =>
<Image source={imageSource} />
- 都相同的情况下?
- 第二种情况会将整个图像加载到内存中吗?
- 什么时候会发布
require
的图像?