Skip to main content
Version: Next

Taro.getApp(opts)

Gets the globally unique App instance of the Mini Program.

Reference

Type

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

Parameters

Option

PropertyTypeRequiredDescription
allowDefaultbooleanNoWhen 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

APIWeChat Mini-ProgramBaidu Smart-ProgramAlipay Mini-ProgramByteDance Mini-ProgramQQ Mini-ProgramJingdong Mini-ProgramH5React NativeQuick App
Taro.getApp✔️✔️✔️✔️✔️✔️✔️✔️✔️