I'm started react-native tutorial on youtube, and I get error this one.
TypeError: ‘undefined’ is not an object
This is File it is showing from:
<Touchable>
<Image
source={require(‘../assets/badalboupic.jpg)} />
<Text >
TafTun AutoMechanics
<Text />
</Touchable>
Please help. Thank You!
CodePudding user response:
This Occurs in Safari: when you read a property or call a method on an undefined object .Initialize state with reasonable default values in the constructor. –
CodePudding user response:
It should be like this :
<TouchableWithoutFeedback>
<>
<Image source={require('../assets/badalboupic.jpg')} />
<Text >TafTun AutoMechanics</Text>
</>
</TouchableWithoutFeedback>
- You missed a quote in your
Image
source - In react native,forward slashes are placed before words in closing tags,not after
- You have to choose between a
TouchableWithoutFeedback
,TouchableOpacity
,TouchableHighlight
or aPressable
element.