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

173
Vistas
How to use dynamic image path in next js

I am new in reactjs and i am working with nextjs,I am fetching image from datbase via api, Right now i am getting image name with full path ( url.com/imagename) but i want to know how can we use dynamic path, in other words if i have only "image name" (not full path) so how can i append "image path" for display image using next js? I tried with following code

{this.state.books.map((post, index) => {
        return (
          <div className="col-md-4"
              <div className="bookimg">
                <img src={post.image} />
              </div>
            </div>
         )
    })}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Let's say that post.image give you the image name only with mimi type.

{this.state.books.map((post, index) => {
    return (
      <div className="col-md-4"
          <div className="bookimg">
            <img src={`myurl.com/image/${post.image}`} />
          </div>
        </div>
     )
})}
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