Reputation: 131
I'm trying to add a logo to my app, and I require the image from a folder inside the project's folder. I followed the docs, and it won't recognize my logo image, I even tried with a different folder and still nothing.
"The module './logowo.png' could not be found"
Any ideas? Thank you!
Upvotes: 2
Views: 5836
Reputation: 1590
As by your error, "The module './logowo.png' could not be found". You might have mis spelled the name of your image instead of ./logwo.png. The path you have mentioned is fine. It works perfectly for me, when i try to mimic the error. You may use it like below,
import React, { Component } from 'react';
import { StyleSheet, Image, Text, View } from 'react-native';
export default class Logo extends Component{
render(){
return(
<View style={styles.container}>
<Image source={require('./logwo.png')} />
</View>
)
}
}
Upvotes: 0
Reputation: 41
try importing the image first?
For example:
At line 9:
import imagename from './logwo.png'
and the image tag:
<Image source = { imagename } />
Upvotes: 1