Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

211
Vistas
Cannot load images from my desktop on React

enter image description hereI have a folder Images on my desktop with .jpg and .svg on my src file that I would like to add on a component but I cannot load them. I don't understand what I'm doing wrong. Can someone help?

import React from 'react';
import './Banner.css';








const Banner = () => {

 
 
        return (

            

            <div className="banner">
                     <img src="../Images/banner.bg.jpg" alt="banner" />
              
                <div className="text">
                    <img src='../Images/party-icon.svg' alt="party" />
             <h3>Let's The Fun Begin!</h3>
            <p>Thanks for your order, we'll have it with you as soon as possible.<br></br>
               Your order number is #10293838 and a confirmation email has been sent to the address provided.</p>

            <p>Order Even Faster in Future</p>
            

            
            <button className="button">CREATE AN ACCOUNT</button>

         
           
            </div>

            
           
            </div>
          
        );
    
}

export default Banner;

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

1 - Your images should sit inside your project source (usually in a 'assets'/'images') folder.

2 - Make sure that the source path in <img src='../Images/party-icon.svg' alt="party" /> is relative to the current file and points to the party-icon.svg sitting in your assets folder.

about 4 years ago · Juan Pablo Isaza Denunciar

0

You may import the pic on top like this:

import bg from '../Images/banner.bg.jpg'

then add your pic like this:

<img src={bg} alt="banner" />

you can do the same thing for other pics. Instead of bg you can write anything you want. Choosing appropriate names for different pictures can be better.

Good luck :)

about 4 years ago · Juan Pablo Isaza Denunciar

0

You can import those separate images & use it on src, or you can use require.

If you place your Images directory inside public folder then you can access your images directly like this

 src="/Images/banner.bg.jpg"

Check the answers of this question (Correct path for img on React.js), I think that may help you to understand those solutions better.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda