Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useLoad / useDidShow 回调函数类型缺少 options 参数 #12983

Closed
toyobayashi opened this issue Dec 14, 2022 · 2 comments · Fixed by #13002
Closed

useLoad / useDidShow 回调函数类型缺少 options 参数 #12983

toyobayashi opened this issue Dec 14, 2022 · 2 comments · Fixed by #13002
Assignees
Labels
A-typings Area - TypeScript Typings 相关 F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Milestone

Comments

@toyobayashi
Copy link

相关平台

H5

浏览器版本: Chrome 108
使用框架: React

复现步骤

用 typescript 写 useLoad((options) => {}),类型报错

期望结果

useLoad / useDidShow 传入带 options 参数的回调函数,类型检查不报错

实际结果

报错

环境信息

Taro CLI 3.5.10 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 16.15.0 - C:\Users\toyobayashi\app\nodejs\node.EXE
      Yarn: 1.22.15 - C:\Users\toyobayashi\app\nodejs\yarn.CMD
      npm: 8.5.5 - C:\Users\toyobayashi\app\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x labels Dec 14, 2022
@ZakaryCode ZakaryCode added the A-typings Area - TypeScript Typings 相关 label Dec 15, 2022
@Chen-jj Chen-jj added this to the 3.5.11 milestone Dec 22, 2022
@ZakaryCode ZakaryCode moved this to Done in H5 Apr 10, 2023
@ZakaryCode ZakaryCode added this to H5 Apr 10, 2023
@wangxiao95
Copy link

useDidShow 传入带 options 参数的回调函数,拿到的参数结果永远是空对象,这什么情况,但是在公共入口ts里的onShow钩子可以拿到参数,页面组件怎么获取onShow的参数?

@Brucia323
Copy link

useDidShow 传入带 options 参数的回调函数,拿到的参数结果永远是空对象,这什么情况,但是在公共入口ts里的onShow钩子可以拿到参数,页面组件怎么获取onShow的参数?

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-typings Area - TypeScript Typings 相关 F-react Framework - React T-h5 Target - 编译到 H5 V-3 Version - 3.x
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants