react-native-wechat出现undefined is not an object

在RN项目中使用第三方插件react-native-wechat
参考文档:https://github.com/weflex/rea...

按照官方文档配置完成后会在执行到应用注册时报错

compinentDidMount(){
    WeChat.registerApp('应用ID');
}

错误如图所示:
图片描述

希望知道'_reactNativeWechat2.default.registerApp'中_reactNativeWechat2是什么鬼?怎么解决?谢谢大家

阅读 6.5k
2 个回答
新手上路,请多包涵

registerApp(appid)

You should call this function in global, calling over twice would throw an error.

// If you register here
componentDidMount (){
wechat.registerApp('your appid')
}
{String} appid the appid you get from WeChat dashboard
returns {Promise}

填写回调的promise 看看

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题