From bd8bba2d63b175c0d050b0c6b96cfdf2609edf30 Mon Sep 17 00:00:00 2001 From: huseeiin <122984423+huseeiin@users.noreply.github.com> Date: Sat, 28 Jun 2025 07:10:58 -0400 Subject: [PATCH] Update index.tsx Type narrowing for useHead --- src/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index ded9fb0..1cc1f13 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -13,9 +13,9 @@ import { isServer, spread, escape, useAssets, ssr } from "solid-js/web"; export const MetaContext = createContext(); -interface TagDescription { - tag: string; - props: Record; +interface TagDescription { + tag: T; + props: props: JSX.HTMLElementTags[T];; setting?: { close?: boolean; escape?: boolean }; id: string; name?: string; @@ -221,7 +221,7 @@ const MetaTag = ( return null; }; -export function useHead(tagDesc: TagDescription) { +export function useHead(tagDesc: TagDescription) { const c = useContext(MetaContext); if (!c) throw new Error(" should be in the tree");