---
name: "preloadPanel"
mode: "kit"
versionRequirements:
  - { name: "BizKit", version: "3.0.0" }
platform:
  - "iOS"
  - "Android"
async: true
---

## preloadPanel

> [VERSION] BizKit >= 3.0.0

> [PLATFORM] iOS, Android

> ⚡ **Supports Promise** — Returns a Promise when success / fail / complete callbacks are omitted.

### Description

Panel pre-download

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | Yes | - | `3.0.0` | Device ID |
| `extraInfo` | `PanelExtraParams` | No | - | `3.0.0` | Additional panel info When pre-downloading a secondary panel, extra information to pass |
| `complete` | `() => void` | No | - | - | Callback invoked when the API call completes (runs on success or failure) |
| `success` | `() => void` | No | - | - | Callback for successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Callback for failed API call |

#### fail callback parameters

| Property | Type | Description |
| --- | --- | --- |
| `errorMsg` | `string` | Error message |
| `errorCode` | `string \| number` | Error code |
| `innerError` | `Object` | Error extension |

##### fail(params).innerError properties

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Error extension code |
| `errorMsg` | `string` | Error extension information |


### Referenced Types

##### `interface` PanelExtraParams

| Property | Type | Required | Since | Description |
| --- | --- | --- | --- | --- |
| `productId` | `string` | Yes | `3.0.0` | Product ID |
| `productVersion` | `string` | Yes | `3.0.0` | Product version |
| `i18nTime` | `string` | Yes | `3.0.0` | Panel i18n timestamp |
| `bizClientId` | `string` | Yes | `3.0.0` | Container ID May be the value of uiid or miniAppId |
| `uiType` | `string` | No | `3.0.0` | Package type RN RN type SMART_MINIPG Mini Program type |
| `uiPhase` | `string` | No | `3.0.0` | Package release status |


### Examples

```tsx
ty.preloadPanel({
  deviceId: "xx",
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
