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

114
Visualizações
Loading files on client-side react application

Good afternoon, I am trying to create a React (static) application, made of only on client-side. I do not need server. On client-side there are several images.. I would like to find a way in which the admin of the application is able to load images and to put them into public/img folder of react application. Is it possible to do something like that?

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

0

Create an assets folder inside src. That will be the folder where you store the images. See React: Adding Images, Fonts, and Files

/* Component.js */
import React from 'react';
import image from 'PathToAssetsFolder/img.png'; // Tell webpack this JS file uses this image

console.log(image); // PathToAssetsFolder/img.84287d09.png

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

export default Header;
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