import React from "react";
import { StyleSheet, View, Image} from "react-native";
const Test = () => {
return (
<View>
<Image source={require('./images/orangutan.jpg')} style={{width: 300, height: 300}} />
</View>
);
};
const styles = StyleSheet.create({
container: {
height: 200, width: 200
},
});
export default Test;
<Image
source={{ uri: 'app_icon' }}
style={{ width: 40, height: 40 }}
/>
<Image
style={styles.tinyLogo}
source={require('@expo/snack-static/react-native-logo.png')}
/>
// useing require is more secure
<Image
source = {require('C:/Users/Tutorialspoint/Desktop/NativeReactSample/logo.png')}
/>
<Image //change imagePath with the real path of your image, for example ./src/image/image.jpg
source={require("imagePath")}
/>
const staticImage = require("./assets/favicon.png");
export default function App() {
return (
<Image
style={styles.tinyLogo}
source={staticImage}
/>
);
}