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

180
Vistas
Need Nextjs <Link> to behave as <a> tag

I have Link to dynamic page as such:

 <Link href={`/event/${event.slug}`}>
      <a className="event-card">
        <img
          className="img-fluid"
          alt={event.name}
          src={event.event_main_image ? event.event_main_image : defaultEventImg}
        ></img>
      </a>
 </Link>

Problem arises when I go to this page through Link and click back and go to another similar dynamic page, there is no refresh of content. Specificly there is a javascript webshop file that get's added to this page and when there is no refresh there is all sorts of buggy behaviour happening.

When I take Link element out and just use a tag like so:

      <a href={`/event/${event.slug}` className="event-card">
        <img
          className="img-fluid"
          alt={event.name}
          src={event.event_main_image ? event.event_main_image : defaultEventImg}
        ></img>
      </a>
   

then everything works, shop works, no buggy behaviour. Problem then is I cant run build with a tags as Nextjs compiler gives you error and tells you to replace a tags with Link.

So my question is how can I get a tag behaviour using Link component?

about 4 years ago · Juan Pablo Isaza
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