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

【4.0.5 - solidjs】solidjs框架下的useDidHide和useDidShow无法触发 #16520

Open
gitlun opened this issue Sep 13, 2024 · 0 comments
Open
Labels
F-solid Framework - Solid T-weapp Target - 编译到微信小程序 V-4 Version - 4.x

Comments

@gitlun
Copy link

gitlun commented Sep 13, 2024

相关平台

微信小程序

小程序基础库: 3.5.6
使用框架: Solidjs

复现步骤

export default function Index() {
useDidShow(() => {
    console.log('show');
  })

  useDidHide(() => {
    console.log('hide');
  })
}

期望结果

正常触发

实际结果

无法触发

环境信息

Taro CLI 4.0.5 environment info:
    npmPackages:
      @tarojs/cli: 4.0.5 => 4.0.5
      @tarojs/components: 4.0.5 => 4.0.5
      @tarojs/helper: 4.0.5 => 4.0.5
      @tarojs/plugin-framework-solid: ^4.0.5 => 4.0.5
      @tarojs/plugin-platform-alipay: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-h5: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-harmony-hybrid: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-jd: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-qq: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-swan: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-tt: 4.0.5 => 4.0.5
      @tarojs/plugin-platform-weapp: 4.0.5 => 4.0.5
      @tarojs/runtime: 4.0.5 => 4.0.5
      @tarojs/shared: 4.0.5 => 4.0.5
      @tarojs/taro: 4.0.5 => 4.0.5
      @tarojs/taro-loader: 4.0.5 => 4.0.5
      @tarojs/webpack5-runner: 4.0.5 => 4.0.5
      babel-preset-taro: 4.0.5 => 4.0.5
      eslint-config-taro: 4.0.5 => 4.0.5

补充信息

在createTaroHook时,改为react的'componentDidShow'和'componentDidHide'就能正常触发

taro/packages/taro-framework-solid/src/runtime/hooks.ts
/** LifeCycle */
--- export const useDidHide = createTaroHook('onHide')
--- export const useDidShow = createTaroHook('onShow')

+++ export const useDidHide = createTaroHook('componentDidHide')
+++ export const useDidShow = createTaroHook('componentDidShow')
@TheKonka TheKonka added T-weapp Target - 编译到微信小程序 V-4 Version - 4.x F-solid Framework - Solid labels Sep 13, 2024
This was referenced Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-solid Framework - Solid T-weapp Target - 编译到微信小程序 V-4 Version - 4.x
Projects
Status: Todo
Development

No branches or pull requests

2 participants