Skip to content

Support for Document Metadata in Preact #4695

Open
@alcompilor

Description

@alcompilor

With the release of React 19’s support for document metadata, managing <title>, <meta>, and other head elements has become convenient, it eliminated the need to use packages like react-helmet to manage these tags. However, when attempting to use preact/compact in my vite.config.ts to render my components, I encountered an issue:

While most functionality worked as expected, metadata tags defined within my pages were not handled correctly. Instead of being embedded in the document <head>, they were rendered inside the body section of my components. This behavior is undesirable and could impact proper SEO and metadata management.

I wanted to check if Preact plans to introduce support for document metadata, similar to React 19. This would be a valuable addition that would make it easier for developers to manage metadata seamlessly when leveraging Preact’s performance benefits.

Would love to hear your thoughts on this!
Thanks for all your great work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions