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

# render

It is used to render project components.

## Usage

```ts
import { render } from '@modern-js/runtime/browser';

render(<ModernRoot />);
```

## Function Signature

```ts
export function render(App: React.ReactElement, id?: HTMLElement | string): Promise<any>;
```

### Parameters

- `App`：An instance of ReactElement created through [`createRoot`](/apis/app/runtime/core/create-root.md).
- `id`：The id of the DOM root element to be mounted, such as "root".

## Example

```tsx
import { createRoot } from '@modern-js/runtime/react';
import { render } from '@modern-js/runtime/browser';

const ModernRoot = createRoot();

async function beforeRender() {
   // todo
}

beforeRender().then(() => {
  render(<ModernRoot />);
});
```
