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

172
Views
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
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!