I want my nextjs app to have a different favicon based on the route. This is the working application where I want to implement this. I want the favicon to become the countries flag whenever someone goes to that countries page.
I have the following code in my react components Head tag:
<Head>
<title>{country.name} | {country.subregion}</title>
<link rel="icon" href={country.flag} />
</Head>
This works sometimes but most of the times the favicon is not updated or the previous favicon stays.