title: Taro.navigateBackMiniProgram(option)
sidebar_label: navigateBackMiniProgram
Returns to the previous Mini Program. It can be called only when the current Mini Program is opened from another Mini Program.
Note: This API is supported as of WeChat 6.5.9 for iOS and 6.5.10 for Android.
Type
(option: Option) => Promise<CallbackResult>
Parameters
Option
| Property | Type | Required | Description |
|---|---|---|---|
| extraData | Record<string, any> |
No | The data that needs to be returned to the previous Mini Program. The previous Mini Program can get this data from App.onShow.Details。 |
| complete | (res: any) => void |
No | The callback function used when the API call completed (always executed whether the call succeeds or fails) |
| fail | (res: any) => void |
No | The callback function for a failed API call |
| success | (res: Result) => void |
No | The callback function for a successful API call |
Sample Code
Taro.navigateBackMiniProgram({extraData: {foo: 'bar'},success: function (res) {// Successful call}})
API Support
| API | WeChat Mini-Program | H5 | React Native |
|---|---|---|---|
| Taro.navigateBackMiniProgram | ✔️ |
