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

用HOC生成的页面组件, componentDidShow函数、onHide在页面显示的时候不执行 #10679

Closed
uniquenaer opened this issue Nov 17, 2021 · 1 comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@uniquenaer
Copy link

uniquenaer commented Nov 17, 2021

相关平台

微信小程序

小程序基础库: 2.20.2
使用框架: React

复现步骤

在用HOC生成的class页面组件中componentDidShow在第一次进入页面甚至切换页面再次进入时都不执行

期望结果

componentDidShow函数在页面显示的时候执行,与useDidShow表现一致

实际结果

componentDidShow函数在页面显示的时候不执行

环境信息

Taro v3.3.14


  Taro CLI 3.3.14 environment info:
    System:
      OS: macOS 12.0.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 12.14.1 - ~/.nvm/versions/node/v12.14.1/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.13.4 - ~/.nvm/versions/node/v12.14.1/bin/npm
    npmPackages:
      @tarojs/components: 3.3.14 => 3.3.14 
      @tarojs/mini-runner: 3.3.14 => 3.3.14 
      @tarojs/react: 3.3.14 => 3.3.14 
      @tarojs/runtime: 3.3.14 => 3.3.14 
      @tarojs/taro: 3.3.14 => 3.3.14 
      @tarojs/webpack-runner: 3.3.14 => 3.3.14 
      @tarojs/with-weapp: 3.3.14 => 3.3.14 
      babel-preset-taro: 3.3.14 => 3.3.14 
      eslint-config-taro: 3.3.14 => 3.3.14 
      react: ^16.10.0 => 16.14.0 
    npmGlobalPackages:
      typescript: 4.4.2
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Nov 17, 2021
@uniquenaer uniquenaer changed the title componentDidShow函数在页面显示的时候不执行,与useDidShow表现不一致 用HOC生成的页面组件, componentDidShow函数、onHide在页面显示的时候不执行 Nov 17, 2021
@AaronDaiR
Copy link

Taro的hoc不支持 didShow吗? 有没有一个好的demo 展示如何更好的用hoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants