Home > Blockchain >  TypeError: ‘undefined’ is not an object (evaluating)
TypeError: ‘undefined’ is not an object (evaluating)

Time:05-16

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>
  1. You missed a quote in your Image source
  2. In react native,forward slashes are placed before words in closing tags,not after
  3. You have to choose between a TouchableWithoutFeedback,TouchableOpacity, TouchableHighlight or a Pressable element.
  • Related