Skip to content

Document head content defined in HTML is not deduplicated #4205

Open
@committomaster

Description

@committomaster

Which project does this relate to?

Router

Describe the bug

With SPAs, some document head content is typically set in HTML before JS is run. The current HeadContent implementation seems to not take this into account and duplicate these tags if overwritten by JS.

Your Example Website or App

https://stackblitz.com/edit/github-ahupwy5s?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. Open the provided example.
  2. Inspect the document tree in dev tools.
  3. Title and meta tags from JS are duplicated instead of overwriting the base values from HTML.

Expected behavior

Router should take the document head content defined in HTML as base for modification by JS.

Screenshots or Videos

Image

Platform

  • OS: any
  • Browser: any
  • Version: any

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions