“Bild in React JS importieren” Code-Antworten

Ein Bild in React JS zeigen

import image from './path-to-image';

<img src={image} height={100} width={100} />
Frail Flatworm

IMG reagieren in einer anderen Datei

//import imgs in a different js file
import lostImage from './assets/img/illustrations/lost.svg';
export { lostImage }; 

//import in the component to use it
import {lostImage} from './images.js'

Grieving Gharial

Importieren Sie ein Bild in React

import mainLogo from'./logoWhite.png';

//then in the render function of Jsx insert the mainLogo variable

class NavBar extends Component {
  render() {
    return (
      <nav className="nav" style={nbStyle}>
        <div className="container">
          //right below here
          <img  src={mainLogo} style={nbStyle.logo} alt="fireSpot"/>
        </div>
      </nav>
    );
  }
}
Akampurira Brian David

Ract -Importbild

import mainLogo from'./logoWhite.png';

<img  src={mainLogo} style={nbStyle.logo} alt="fireSpot"/>
Evil Earthworm

Bild in React JS importieren

 <script src="../node_modules/jquery/dist/jquery.min.js"></script>
    <script src="../node_modules/bootstrap/dist/js/bootstrap.js"></script>
Aggressive Armadillo

Ähnliche Antworten wie “Bild in React JS importieren”

Fragen ähnlich wie “Bild in React JS importieren”

Weitere verwandte Antworten zu “Bild in React JS importieren” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen