You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constSomeComponent: React.FC=()=>{useEffect(()=>{constexecuteAutoLogin=(options: Taro.onAppShow.CallbackResult): void=>{// do something}Taro.onAppShow(executeAutoLogin)return()=>{offAppShow(executeAutoLogin)// 这里报错,错误信息在下一段}},[])return<View></View>}
Argument of type '(options: Taro.onAppShow.CallbackResult) => void' is not assignable to parameter of type '(res: CallbackResult) => void'.
Types of parameters 'options' and 'res' are incompatible.
Type 'CallbackResult' is missing the following properties from type 'CallbackResult': path, query, referrerInfo, scene, shareTicketts(2345)
相关平台
微信小程序
小程序基础库: 2.11.0
使用框架: React
复现步骤
这是因为
onAppShow
和offAppShow
的回调函数类型不一致,除了这两个函数外,还有其他 onXXX 和 offXXX 的函数也都有类似问题。期望结果
onAppShow
和offAppShow
的回调函数使用同一类型实际结果
onAppShow
和offAppShow
的回调函数没有使用同一类型环境信息
The text was updated successfully, but these errors were encountered: