lundi 20 avril 2015

React Native Image element crashing with a URI location

I'm trying to display an image with a URI location instead of a static image and it's not working. I'm getting the red screen with the message: 'You are trying to render the global Image variable as a React element. You probably forgot to require Image.' I simply took the default project (react-native init awesomeProject) and added this inside the View after the two Text elements:

<Image 
    style = {styles.base}
    source={{uri: 'http://ift.tt/MIVljy'}}
/>

and I enhanced the styles with an additional property:

base: {
    height: 400,
    width: 400 
},

I can't figure out why this wouldn't work as this is the simple example in the React Native docs. Any advice?

Aucun commentaire:

Enregistrer un commentaire