Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
Cómo ver una imagen cargada en reaccionar en el navegador

Tengo una interfaz de reacción y quiero ver la imagen en el navegador cuando subo la imagen. A continuación se muestra mi función de carga

 onDrop = async (files) => { const FILES = { "uploaded_image": [{ name: files[0].name, <- Name prints on screen succesfully image: files[0].file, <- It is just empty }] } this.setState({ ...some states }) ..some calls }

Y abajo está el render

 <div> <Image src={this.state.files[0].image} /> </div>

La imagen muestra si codifico el campo directamente,

 image: require(`static_media/car.png`).default

Pero me gustaría mostrar sin codificar la ruta del archivo cargado, ¿cómo puedo modificar el image field en onDrop para hacer eso?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

necesita usar URL.createObjectURL (archivos [0])

 const FILES = { "uploaded_image": [{ name: files[0].name, <- Name prints on screen succesfully image: URL.createObjectURL(files[0]), <- It is just empty }] }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!