title: Taro.getApp(opts)

sidebar_label: getApp

Gets the globally unique App instance of the Mini Program.

Reference

Type

  1. <T = Record<string, any>>(opts?: Option) => Instance<T>

Parameters

Option

Property Type Required Description
allowDefault boolean No When App is undefined, the default implementation is returned. When App is called, the properties defined in the default implementation are overridden and merged into App. Generally, this is used for Independent Subpackage.

Instance

API Support

API WeChat Mini-Program Baidu Smart-Program Alipay Mini-Program ByteDance Mini-Program QQ Mini-Program Jingdong Mini-Program H5 React Native Quick App
Taro.getApp ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️ ✔️