---
name: "backToHomeAndOpenPanel"
mode: "kit"
versionRequirements:
  - { name: "BizKit", version: "3.2.7" }
  - { name: "@ray-js/ray", version: "1.4.57" }
platform:
  - "iOS"
  - "Android"
async: true
---

## backToHomeAndOpenPanel

> [VERSION] BizKit >= 3.2.7 | @ray-js/ray >= 1.4.57

> [PLATFORM] iOS, Android

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

### Description

Go back to the home page and open the panel

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `deviceId` | `string` | Yes | - | `3.2.7` | Device info ID |
| `extraInfo` | `PanelExtraParams` | No | - | `3.2.7` | Additional panel info When navigating to a secondary panel, additional information needs to be passed |
| `initialProps` | `Record<string, Record<string, any>>` | No | - | `3.2.7` | Launch parameters carried by the panel |
| `removeUIInfo` | `boolean` | No | `false` | `4.21.2` | Remove UI info When true, removes the panel’s UI information (including localization) |
| `complete` | `() => void` | No | - | - | Completion callback (executed on both success and failure) |
| `success` | `() => void` | No | - | - | Callback on successful API call |
| `fail` | `(params: Object) => void` ↓see below | No | - | - | Failure callback |

#### 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 message |


### Referenced Types

##### `interface` PanelExtraParams

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


### Examples

#### Demo

```tsx
import { backToHomeAndOpenPanel } from '@ray-js/ray'

backToHomeAndOpenPanel({
  deviceId: "xx",
  removeUIInfo: false,
  success: data => {
    console.log(data);
  },
  fail: error => {
    console.error(error);
  },
});
```
