Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

img src in react js

import Logo from “./logo.png”;
<img src={Logo}/>
Comment

img tag in react

//two way to use image in react
Option 1: Put the image in the public directory
public/images/thing.jpg, you could display that image this way:
   <img src="images/logo.jpg" />

Option 2: import the image into the component
import Logo from “./logo.jpg”;
<img src={Logo}/>
Comment

PREVIOUS NEXT
Code Example
Javascript :: using dto in express 
Javascript :: how to cache data in javascript 
Javascript :: pass props in link next js 
Javascript :: javascript easiest way to get second parent 
Javascript :: Creating a Node.js MySQL Database 
Javascript :: javascript get current day of month 
Javascript :: print all variables defined javascript 
Javascript :: node.js express post query string 
Javascript :: open bootstrap modal with javascript 
Javascript :: javascript falsy 
Javascript :: datatables on row created 
Javascript :: react aos animation 
Javascript :: this.props.history.location.push 
Javascript :: npm react pagination 
Javascript :: math round 
Javascript :: datatables search not working 
Javascript :: sweet alert in java Script 
Javascript :: binary gap 
Javascript :: function range() as range js 
Javascript :: get last word in string js 
Javascript :: input radio trigger select jquery 
Javascript :: ngstyle background url angular 
Javascript :: axios add no cors 
Javascript :: genius lyrics api 
Javascript :: jquery insert after next element 
Javascript :: javascript join list of string 
Javascript :: javascript example of foreach loop 
Javascript :: Array Foreach Loop 
Javascript :: generate random string react 
Javascript :: how to ssh into gke node 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =