Answers for "react require image"

12

import img react

//if you have images in src folder
import shoe1 from './img/shoe_01.jpg'
const Shoe = (e) => {
	return ( 
        <div className="shoe-container">
            <img src={shoe1} alt=""/>
        </div>
    );
}
//if you have images in public folder:
//will look in folder /public/img/shoe_01.jpg
const Shoe = (e) => {
	return ( 
        <div className="shoe-container">
            <img src="/img/shoe_01.jpg" alt=""/>
        </div>
    );
}
Posted by: Guest on September-09-2020
3

photo in React native

// useing require is more secure
<Image 
	source = {require('C:/Users/Tutorialspoint/Desktop/NativeReactSample/logo.png')} 
/>
Posted by: Guest on September-16-2020

Code answers related to "react require image"

Code answers related to "Javascript"

Browse Popular Code Answers by Language