__CreateComponent

Introduction

Creates a ComponentElement object.

Syntax

__CreateComponent(componentParentUniqueID: number, componentID: string, cssID: Number, entryName: string, name: string, path: string, config: Record<string, any>|null|undefined, info: Record<string, any>|null|undefined): Element;

Parameters

Key Description
parentComponentUniqueID The Unique Component ID of the ComponentElement that creates this Element, which is a number.
componentID The componentID set by the frontend framework for the ComponentElement, which is a case-sensitive string.
cssID The CSSFragment ID, which is of type number.
entryName The schema information of the Lazy Bundle where the current ComponentElement is located, which is a case-sensitive string.
name The frontend-defined name of the current ComponentElement, which is a case-sensitive string.
path The frontend path of the current ComponentElement, which is a case-sensitive string.
config The configuration for the current ComponentElement.
info Some additional information required when creating the ComponentElement; this parameter can be omitted.

Return Value

Returns the ComponentElement.

Example

The frontend framework can create a ComponentElement in the following way.

// main-thread.js
let element = __CreateComponent(0, '1', 1, '', 'name', 'path', {}, {});
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.