react-native-hr icon indicating copy to clipboard operation
react-native-hr copied to clipboard

Element type is invalid

Open armnotstrong opened this issue 7 years ago • 1 comments

Hey, trying to use react-native-hr in my project as this:

import {Hr} from 'react-native-hr'
    ...
    class MyListItem extends PureComponent {
 render(){
   return (
     <View style={styles.detailCard}>
     

         <Text style={styles.detailCardContent}>{this.props.content}</Text>
         <Hr />
         <Text> --{this.props.re}</Text>
         <Text>=====================</Text>
         </View>
     );
 }

}

But above code gives me an error:

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.

armnotstrong avatar Jul 22 '17 00:07 armnotstrong

You should import the component as follows: : import Hr from 'react-native-hr'

mealbarracin10 avatar Aug 06 '17 03:08 mealbarracin10