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?