Answers for "how can i convert local image to url in react native"

2

how to dynamically show image from local storage in react native

// our data
// we need to require all images, 
// so that React Native knows about them statically
const items = [
    {
        id: '001',
        image: require('../images/001.jpeg'),
    },
    {
        id: '002',
        image: require('../images/002.jpeg'),
    },
];

// render
items.map( (item) => 
    <Image key={item.id} source={item.image} />
)
Posted by: Guest on October-31-2020
3

render image url in react native

import React, { Component } from 'react';
import {
 AppRegistry, Image
} from 'react-native';

export default class Myproject extends Component {
 render() {

 let Image_Http_URL ={ uri: 'https://reactnativecode.com/wp-content/uploads/2017/05/react_thumb_install.png'};

 return (
 <Image source={Image_Http_URL} style = {{height: 200, resizeMode : 'stretch', margin: 5 }} />
 );
 }
}

AppRegistry.registerComponent('Myproject', () => Myproject);
Posted by: Guest on November-17-2020

Code answers related to "how can i convert local image to url in react native"

Code answers related to "Javascript"

Browse Popular Code Answers by Language