> 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.

# `__UpdateComponentID`

## 介绍

更新 ComponentElement 的 componentID。

## 语法

```jsx
__UpdateComponentID(element: Element, componentID: string) : void;
```

### 参数

|     Key     | 说明                                                 |
| :---------: | -------------------------------------------------- |
|   element   | 任意的 ComponentElement。                              |
| componentID | 前端框架设置给 ComponentElement 的 componentID，是大小写敏感的字符串。 |

### 返回值

无返回值。

## 示例

前端框架可以按下如下的方法更新 ComponentElement 的 componentID。

```jsx
// main-thread.js
let element = __CreateComponent(0, '1', 1, '', 'name', 'path', {}, {});

__UpdateComponentID(element, '2');
```
