For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/react/Functions/createElement.md.
  • 简体中文
  • 函数: createElement()

    使用 snapshot 运行时创建 ReactLynx 元素。

    调用签名

    createElement<Type extends keyof IntrinsicElements>(type: Type, props?: IntrinsicElements[Type] | null, ...children: ReactNode[]): ReactElement<IntrinsicElements[Type], Type>

    创建一个 Lynx 内置元素。

    类型参数

    类型参数
    Type extends keyof IntrinsicElements

    参数

    参数类型
    typeType
    props?IntrinsicElements[Type] | null
    ...children?ReactNode[]

    返回

    ReactElement<IntrinsicElements[Type], Type>

    调用签名

    createElement<Props extends object>(type: string | ComponentType<Props>, props?: Attributes & Props | null, ...children: ReactNode[]): ReactElement<Props>

    创建一个组件元素。

    类型参数

    类型参数
    Props extends object

    参数

    参数类型
    typestring | ComponentType<Props>
    props?Attributes & Props | null
    ...children?ReactNode[]

    返回

    ReactElement<Props>

    示例

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。