Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react image

<img src={require('./logo.jpeg')} />

import logo from './logo.jpeg'; // with import    
const logo = require('./logo.jpeg); // with require
<img src={logo} />
Comment

image react

First method 
import logo from './logo.jpeg';    <img src={logo} />
Second Method
const logo = require('./logo.jpeg); <img src={logo.default} />
Third Method
<img src={require('./logo.jpeg').default} />
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery modify style attribute 
Javascript :: js get part of array 
Javascript :: eslint ignore file rule 
Javascript :: first digit javascript 
Javascript :: create number pyramid in javascript 
Javascript :: formdata to json 
Javascript :: js check if function exists 
Javascript :: javascript reverse array 
Javascript :: javascript change frame background 
Javascript :: javascript check if elements of one array are in another 
Javascript :: are you sure javascript 
Javascript :: ajax load spesific element from another page 
Javascript :: js json groupby prop 
Javascript :: FileReader get filename 
Javascript :: js change button text 
Javascript :: ascending and descending val in array using js 
Javascript :: javascript dataurl to blob 
Javascript :: js open window in new tab 
Javascript :: string to title case javascript 
Javascript :: vite install in vue 
Javascript :: javascript switch 
Javascript :: attr hidden to show jquery 
Javascript :: toggle bollean value in js 
Javascript :: javascript get random integer in given range 
Javascript :: vue property decorator emit 
Javascript :: js cookies 
Javascript :: how to print line break in javascript 
Javascript :: set css variable from javascript 
Javascript :: install react js 
Javascript :: javascript document remove 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =