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 :: how reliable is js hasownproperty 
Javascript :: create document mongoose 
Javascript :: react native password strength 
Javascript :: append after div 
Javascript :: swapping variables js 
Javascript :: loop object array 
Javascript :: innertext javascript 
Javascript :: open new window javascript 
Javascript :: what is last index of array 
Javascript :: javascript detect scroll wheel 
Javascript :: how to capitalize the first letter of a word in javascript 
Javascript :: lodash reduce 
Javascript :: jszip create zip file 
Javascript :: javascript date for 5 seconds from now 
Javascript :: uml diagram javascript 
Javascript :: how to convert a string to react element in javascript 
Javascript :: document.addEventListener("backbutton 
Javascript :: javascript to array 
Javascript :: if keypress javascript 
Javascript :: Error: A Route is only ever to be used as the child of element, never rendered directly. Please wrap your Route in a Route 
Javascript :: babel start command nodejs 
Javascript :: javascipt delay 
Javascript :: on window resize and on page load 
Javascript :: react arrow funvtion 
Javascript :: object methods in javascript 
Javascript :: javascript convert date from mm/dd/yyyy to yyyymmdd 
Javascript :: await loop javascript 
Javascript :: react alice carousel 
Javascript :: fibonacci series with recursion in javascript 
Javascript :: toggle text on click in angular 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =