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

177
Visualizações
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 à 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