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 :: reduce object to array javascript 
Javascript :: local storage in vanila javascript 
Javascript :: data types in javascript 
Javascript :: promise with timeout js 
Javascript :: jquery json to table 
Javascript :: datepicker min max date 
Javascript :: delete from list javascript 
Javascript :: pause javascript 
Javascript :: disable link react 
Javascript :: get request with axios 
Javascript :: how to send response to client in nodejs using res object 
Javascript :: find an object from array of objects javascript 
Javascript :: navlink activestyle not working 
Javascript :: react native firebase email verification 
Javascript :: lastindexof() javascript 
Javascript :: cordova delete cache 
Javascript :: get duplicate value javascript 
Javascript :: react html parser 
Javascript :: how to make a grocery list in javascript 
Javascript :: post request with data and headers 
Javascript :: Factorialize a Number 
Javascript :: discord.js presence update 
Javascript :: d3 not reading json 
Javascript :: how to pass a prop in route 
Javascript :: node check if internet 
Javascript :: foreach method javascript 
Javascript :: Flatten a multidimension array 
Javascript :: javascript read consol input 
Javascript :: or operator javascript 
Javascript :: react-native-community/blur 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =