Created a post earlier which I thought were working and it was marked solved so have to create another one now.
I'm trying to add a <script> tag with dynamic content which I need for SEO purposes to be able to add ld+json schema.org content.
I've tried adding this to both /article/[id]/page.tsx and /article/[id]/layout.tsx:
id="schema.org"
type="application/ld+json"
strategy="afterInteractive"
key={content.id}
>
{JSON.stringify(generateRecipeJSONLD(content))}
</Script>
Thing is, it works on first initial load, but when I navigate using the <Link> component to the root page and then back to another article the content isn't updated.
Also tried different strategies on the <Script> tag without success.
Is this the right approach of doing this or are there better ways? Or is it a bug?
Many thanks in advance!