import { TouchableOpacity } from 'react-native-gesture-handler';
react-native에서 가져오면 된다
import { TouchableOpacity } from 'react-native'
<Image source={require('./myimage.png')} />
// BAD
var icon = this.props.active ? 'my-icon-active' : 'my-icon-inactive';
<Image source={require('image!' + icon)} />
// GOOD
var icon = this.props.active ? require('image!my-icon-active') : require('image!my-icon-inactive');
<Image source={icon} />
const loadingGif = [
require('../../assets/loading/america.gif'),
require('../../assets/loading/daft.gif'),
//..
]
const gifUri = loadingGif[Math.floor(Math.random() * loadingGif.length)]
<Image
source={gifUri}
style={{ width: 60, height: 40 }} />
<Image
source={gifUri}
style={{ width: "40%", aspectRatio: 1, resizeMode: "contain" }}
/>