Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

267
Visualizações
images is not rendered in the browser(Reactjs)

I am trying to load a local image in my Nav component and in the landing page.

So this is what I've done so far:

const LandingScreen = ()=>{

    return(
        <div>
           <img src ={'../Images/auction.jpg' } style={{width:100, height:100}} />
        </div>
    )

};

export default LandingScreen;

and this is my App component:

import './App.css';
import Header from './Components/Header/Header';
import Footer from './Components/Footer/Footer';
import './bootstrap.css';
import Register from './Screens/RegisterScreen/Register';
import Login from './Screens/LoginScreen/Login';
import {Route, BrowserRouter as Router, Routes} from 'react-router-dom';
import LandingScreen from './Screens/LandingScreen';

const App = ()=> {
  return (
    <Router>
      <Header/>
      <Routes className ="front">
        <Route path="/" element={<LandingScreen/>} exact/>
        <Route path ="/register" element ={<Register/>}/>
        <Route path ="/login" element ={<Login/>}/>
      </Routes>
      <Footer/>
    </Router>
     
  );
}

export default App;

And this is the result that I am getting in the browser: How the image appear in the browser

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

according to CRA documentation you should import you image first, then use it in your img tag

https://create-react-app.dev/docs/adding-images-fonts-and-files/

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda