Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/react-router/src/HeadContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ import { useRouter } from './useRouter'
import { useRouterState } from './useRouterState'
import type { RouterManagedTag } from '@tanstack/router-core'

const METAS_TO_ALLOW_MULTIPLE = new Set(['theme-color'])

function shouldDeduplicateMetaTag(attribute: string) {
return METAS_TO_ALLOW_MULTIPLE.has(attribute) === false
}

/**
* Build the list of head/link/meta/script tags to render for active matches.
* Used internally by `HeadContent`.
Expand Down Expand Up @@ -37,7 +43,10 @@ export const useTags = () => {
} else {
const attribute = m.name ?? m.property
if (attribute) {
if (metaByAttribute[attribute]) {
if (
metaByAttribute[attribute] &&
shouldDeduplicateMetaTag(attribute)
) {
continue
} else {
metaByAttribute[attribute] = true
Expand Down
Loading