How MetaProvider manages head tags
mainThe MetaProvider uses a context-based system to track tags.
- Cascading Tags: Tags like
<title>and<meta>are treated as 'cascading'. This means if multiple components attempt to set the same title or meta property, the library manages them as singletons or handles their priority/ordering to prevent duplicate or conflicting entries in the head. - Lifecycle: When a component using a meta component mounts, the tag is added to the
<head>. When the component unmounts, the tag is automatically removed. - SSR Support: On the server,
MetaProvidercollects all tags rendered during the component tree traversal and usesuseAssetsto ensure they are included in the final HTML output.