> For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt.

# createRoot

用于创建 Modern.js 提供的根组件，该根组件会自动注册 Runtime 插件，并完成 Runtime 插件初始化。

## 使用姿势

```ts
import { createRoot } from '@modern-js/runtime/react';
```

## 函数签名

```ts
export function createRoot(
  UserApp?: React.ComponentType | null,
): React.ComponentType<any>;
```

### 参数

- `UserApp` 可选参数，默认为 `App.tsx` 导出的组件
