“IMG SRC di React JS” Kode Jawaban

bereaksi img

import React from 'react';
import logo from './logo.png'; // Tell webpack this JS file uses this image

console.log(logo); // /logo.84287d09.png

function Header() {
  // Import result is the URL of your image
  return <img src={logo} alt="Logo" />;
}

export default Header;
Bewildered Bug

IMG SRC di React JS

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

Tag IMG di 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}/>
Sab Tech

Jawaban yang mirip dengan “IMG SRC di React JS”

Pertanyaan yang mirip dengan “IMG SRC di React JS”

Lebih banyak jawaban terkait untuk “IMG SRC di React JS” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya