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

子组件componentDidShow无法触发 #8148

Closed
robinv8 opened this issue Nov 28, 2020 · 4 comments
Closed

子组件componentDidShow无法触发 #8148

robinv8 opened this issue Nov 28, 2020 · 4 comments
Labels
F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@robinv8
Copy link
Member

robinv8 commented Nov 28, 2020

相关平台

微信小程序

复现仓库

https://git.undefined.com
小程序基础库: 2.14.0
使用框架: React

复现步骤

根据官方脚手架初始化项目,分别在页面及组件内容添加 componentDidShow ,页面内可以触发,组件无法触发

期望结果

组件触发componentDidShow

实际结果

组件内未触发componentDidShow

环境信息


  Taro CLI 3.0.17 environment info:
    System:
      OS: macOS 11.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 12.18.3 - ~/.nvs/default/bin/node
      Yarn: 1.22.4 - ~/.yarn/bin/yarn
      npm: 6.14.6 - ~/.nvs/default/bin/npm
    npmPackages:
      @tarojs/components: 3.0.10 => 3.0.10 
      @tarojs/mini-runner: 3.0.10 => 3.0.10 
      @tarojs/react: 3.0.10 => 3.0.10 
      @tarojs/runtime: 3.0.10 => 3.0.10 
      @tarojs/taro: 3.0.10 => 3.0.10 
      @tarojs/webpack-runner: 3.0.10 => 3.0.10 
      babel-preset-taro: 3.0.10 => 3.0.10 
      eslint-config-taro: 3.0.10 => 3.0.10 
      react: ^16.10.0 => 16.14.0 
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Nov 28, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Dec 22, 2020

@Chen-jj Chen-jj closed this as completed Dec 22, 2020
@shenX-2021
Copy link

@Chen-jj
Copy link
Contributor

Chen-jj commented Dec 29, 2020

@gxsandzxl 2.x 每个 React Component 都对应一个小程序自定义组件,应该是可以直接使用 onShow onHide

@shenX-2021
Copy link

@Chen-jj 不好意思,忘记说明了,是2.x的H5环境。
我说一下我的问题吧。
主要是H5的子组件的componentDidShow无法触发,但可以通过页面组件调用子组件的方法来代替实现。但是最近接入了redux,有个ref问题官方一直没有解决,导致现在两种方法都失效了。

想请问一下官方近期对这两个问题有计划解决吗?

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

3 participants