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.

Reference

Type

  1. (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

  1. Taro.navigateBackMiniProgram({
  2. extraData: {
  3. foo: 'bar'
  4. },
  5. success: function (res) {
  6. // Successful call
  7. }
  8. })

API Support

API WeChat Mini-Program H5 React Native
Taro.navigateBackMiniProgram ✔️