Use Images in a React Native Application

Tyler McGinnis
InstructorTyler McGinnis

Share this video with your friends

Send Tweet

Let's take a look at the basics of using React Native's Image component, as well as adding some reusable styling to our Dashboard component buttons.

jack
jack
~ 6 years ago

Hi,

I like to use the Image component for images stored locally in my app. I don't what the path of the images should be and where to put the images in my project folders.

Thanks, Jack

Dmitrii Chudinov
Dmitrii Chudinov
~ 6 years ago

Hi! Try this source: source={require('image!myIcon')} And you should put your images into Images.xcassets folder in Xcode.

Laurie
Laurie
~ 4 years ago

I believe there is a change to the github api in that your images will not be displaying if you try and find the 'avatar_url' key inside the userInfo object.

I had to write this.props.userInfo[0].owner.avatar_url to access the correct information to get the profile image to display.

Hope that helps!