---
name: "navigateBack"
mode: "kit"
versionRequirements:
  - { name: "MiniKit", version: "1.0.0" }
platform:
  - "iOS"
  - "Android"
async: true
---

## navigateBack

> [VERSION] MiniKit >= 1.0.0

> [PLATFORM] iOS, Android

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

### Description

Close the current page and go back to the previous page or multiple levels

### Parameters

| Property | Type | Required | Default | Since | Description |
| --- | --- | --- | --- | --- | --- |
| `delta` | `number` | No | `1` | `1.0.0` | Number of pages to go back; if delta exceeds the number of existing pages, returns to the Home page |
| `complete` | `() => void` | No | - | - | Completion callback (called on success or failure) |
| `success` | `() => void` | No | - | - | Success callback |
| `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 extensions |

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

| Property | Type | Description |
| --- | --- | --- |
| `errorCode` | `string \| number` | Extended error code |
| `errorMsg` | `string` | Extended error information |


### Examples

```tsx
ty.navigateBack({
  delta: 1,
  success: data => { console.log(data); },
  fail: error => { console.error(error); },
});
```
