Display local image in react native

Viewed 1614

How to display an image from local file? This code doesn't seem to work.

<Image
    source={{
        uri: 'file:///data/data/com/files/image.png',
    }}
/>
2 Answers

if the image is in the local system then instead of the following below

<Image
    source={{
        uri: 'file:///data/data/com/files/image.png',
    }}
/>

try simply

<Image
    source={require('file:///data/data/com/files/image.png')}
/>
Related