Skip to content

Instantly share code, notes, and snippets.

@topherPedersen topherPedersen/App.js
Last active Nov 10, 2019

Embed
What would you like to do?
How to Load an <Image/> in React Native
// NOTE: In the same directory as your App.js file,
// create a new folder called "assets", and place
// your image file (.jpg) in that directory.
import React, { Component } from 'react';
import { Text, View, Image } from 'react-native';
class App extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View>
<Text>RENDER AN IMAGE...</Text>
<Image source={ require('./assets/supersweetimage.jpg') } />
</View>
);
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.