Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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}/>
Source by www.edwardbeazer.com #
 
PREVIOUS NEXT
Tagged: #img #tag #react
ADD COMMENT
Topic
Name
5+4 =