typed
This commit is contained in:
parent
c52e79faf0
commit
0b8ee33ed5
|
@ -1,15 +1,15 @@
|
||||||
import {
|
import {
|
||||||
Component,
|
Component,
|
||||||
|
JSX,
|
||||||
|
ParentComponent,
|
||||||
createContext,
|
createContext,
|
||||||
createRenderEffect,
|
createRenderEffect,
|
||||||
createUniqueId,
|
createUniqueId,
|
||||||
JSX,
|
|
||||||
onCleanup,
|
onCleanup,
|
||||||
ParentComponent,
|
|
||||||
sharedConfig,
|
sharedConfig,
|
||||||
useContext,
|
useContext,
|
||||||
} from 'solid-js'
|
} from 'solid-js'
|
||||||
import { isServer, spread, escape as escapeMeta, useAssets, ssr } from 'solid-js/web'
|
import { escape as escapeMeta, isServer, spread, ssr, useAssets } from 'solid-js/web'
|
||||||
|
|
||||||
export const MetaContext = createContext<MetaContextType>()
|
export const MetaContext = createContext<MetaContextType>()
|
||||||
|
|
||||||
|
@ -253,16 +253,19 @@ function renderTags(tags: TagDescription[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Title: Component<JSX.HTMLAttributes<HTMLTitleElement>> = (props) =>
|
export const Title: Component<JSX.HTMLAttributes<HTMLTitleElement>> = (props) =>
|
||||||
MetaTag('title', props, { escape: true, close: true })
|
MetaTag('title', props as { [k: string]: string }, { escape: true, close: true })
|
||||||
|
|
||||||
export const Style: Component<JSX.StyleHTMLAttributes<HTMLStyleElement>> = (props) =>
|
export const Style: Component<JSX.StyleHTMLAttributes<HTMLStyleElement>> = (props) =>
|
||||||
MetaTag('style', props, { close: true })
|
MetaTag('style', props as { [k: string]: string }, { close: true })
|
||||||
|
|
||||||
export const Meta: Component<JSX.MetaHTMLAttributes<HTMLMetaElement>> = (props) => MetaTag('meta', props)
|
export const Meta: Component<JSX.MetaHTMLAttributes<HTMLMetaElement>> = (props) =>
|
||||||
|
MetaTag('meta', props as { [k: string]: string })
|
||||||
|
|
||||||
export const Link: Component<JSX.LinkHTMLAttributes<HTMLLinkElement>> = (props) => MetaTag('link', props)
|
export const Link: Component<JSX.LinkHTMLAttributes<HTMLLinkElement>> = (props) =>
|
||||||
|
MetaTag('link', props as { [k: string]: string })
|
||||||
|
|
||||||
export const Base: Component<JSX.BaseHTMLAttributes<HTMLBaseElement>> = (props) => MetaTag('base', props)
|
export const Base: Component<JSX.BaseHTMLAttributes<HTMLBaseElement>> = (props) =>
|
||||||
|
MetaTag('base', props as { [k: string]: string })
|
||||||
|
|
||||||
export const Stylesheet: Component<Omit<JSX.LinkHTMLAttributes<HTMLLinkElement>, 'rel'>> = (props) => (
|
export const Stylesheet: Component<Omit<JSX.LinkHTMLAttributes<HTMLLinkElement>, 'rel'>> = (props) => (
|
||||||
<Link rel="stylesheet" {...props} />
|
<Link rel="stylesheet" {...props} />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user