Function createElement

  • Creates an HTML element

    Type Parameters

    Parameters

    • tagName: T

      Name of HTML element

    • Optional props: null | HTMLElementProps<T>

      Element properties, such as class, id, style, etc

    • Rest ...children: ChildrenType

      Children of this element. Can be nothing, number, string, boolean, bigint, or more elements. An array will create multiple, flattened children.

    Returns HTMLElementTagNameMap[T]

    HTML element

    Throws

    • If tagNameOrFunction is not a string or function, an errow is thrown
  • Creates a deprecated HTML element

    Type Parameters

    Parameters

    • tagName: T

      Name of HTML element

    • Optional props: null | HTMLDeprecatedElementProps<T>

      Element properties, such as class, id, style, etc

    • Rest ...children: ChildrenType

      Children of this element. Can be nothing, number, string, boolean, bigint, or more elements. An array will create multiple, flattened children.

    Returns HTMLElementDeprecatedTagNameMap[T]

    Deprecated HTML element

    Deprecated

    Throws

    • If tagNameOrFunction is not a string or function, an errow is thrown
  • Creates an SVG element

    Type Parameters

    Parameters

    • tagName: `svg:${T}`

      In the format of svg:tagName

    • Optional props: null | SVGElementProps<T>

      Element properties, such as class, id, style, etc

    • Rest ...children: ChildrenType

      Children of this element. Can be nothing, number, string, boolean, bigint, or more elements. An array will create multiple, flattened children.

    Returns SVGElementTagNameMap[T]

    SVG elment

    Throws

    • If tagNameOrFunction is not a string or function, an errow is thrown
  • Creates an XHTML element

    Type Parameters

    • T extends (keyof HTMLElementTagNameMap) | (keyof HTMLElementDeprecatedTagNameMap)

    Parameters

    • tagName: `xhtml:${T}`

      In the format of xhtml:tagName

    • Optional props: null | XHTMLElementProps<T>

      Element properties, such as class, id, style, etc

    • Rest ...children: ChildrenType

      Children of this element. Can be nothing, number, string, boolean, bigint, or more elements. An array will create multiple, flattened children.

    Returns HTMLElement

    XHTML elment

    Throws

    • If tagNameOrFunction is not a string or function, an errow is thrown
  • Creates a mathML element

    Type Parameters

    Parameters

    • tagName: `mathML:${T}`

      In the format of mathML:tagName

    • Optional props: null | ElementProps

      Element properties, such as class, id, style, etc

    • Rest ...children: ChildrenType

      Children of this element. Can be nothing, number, string, boolean, bigint, or more elements. An array will create multiple, flattened children.

    Returns MathMLElementTagNameMap[T]

    MathML elment

    Throws

    • If tagNameOrFunction is not a string or function, an errow is thrown
  • Creates a namespaced element

    Parameters

    • tagName: `xmlns:${string}` | `xml:${string}` | `xlink:${string}`

      In the format of namespaceName:tagName, where namespaceName is one of "xml", "xlink", or "xmlns"

    • Optional props: null | ElementProps

      Element properties, such as class, id, style, etc

    • Rest ...children: ChildrenType

      Children of this element. Can be nothing, number, string, boolean, bigint, or more elements. An array will create multiple, flattened children.

    Returns Element

    Element

    Throws

    • If tagNameOrFunction is not a string or function, an errow is thrown
  • Creates a function component

    Type Parameters

    • Props extends {}
    • Children extends unknown[]
    • Returns extends Node | Element

    Parameters

    Returns Returns

    Element

    Throws

    • If tagNameOrFunction is not a string or function, an errow is thrown

Generated using TypeDoc