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

[Taro3]页面采用函数组件配合redux,react会报错 #6991

Closed
myl0204 opened this issue Jul 10, 2020 · 1 comment
Closed

[Taro3]页面采用函数组件配合redux,react会报错 #6991

myl0204 opened this issue Jul 10, 2020 · 1 comment
Labels
duplicate This issue or pull request already exists F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x

Comments

@myl0204
Copy link
Contributor

myl0204 commented Jul 10, 2020

相关平台

微信小程序

复现仓库

https://github.com/myl0204/taro_bug_report
小程序基础库: 2.10.1
使用框架: React

复现步骤

启动项目后可以在控制台看到报错

VM67:1 Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s%s

Check the render method of ConnectFunction.
in Index (created by ConnectFunction)
in ConnectFunction (created by Page)
in root (created by Page)
in Page (created by AppWrapper)
in Provider (created by App)
in App (created by AppWrapper)
in AppWrapper

期望结果

不报错

实际结果

报错

环境信息

Taro CLI 3.0.2 environment info:
    System:
      OS: macOS 10.14.6
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 10.16.3 - /var/folders/_3/wg3rh3_n0hg717bgfzcy8rmw0000gp/T/yarn--1594347472808-0.27392778454151534/node
      Yarn: 1.22.4 - /var/folders/_3/wg3rh3_n0hg717bgfzcy8rmw0000gp/T/yarn--1594347472808-0.27392778454151534/yarn
      npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
    npmPackages:
      @tarojs/cli: ^3.0.2 => 3.0.2
      @tarojs/components: 3.0.2 => 3.0.2
      @tarojs/mini-runner: 3.0.2 => 3.0.2
      @tarojs/react: 3.0.2 => 3.0.2
      @tarojs/runtime: 3.0.2 => 3.0.2
      @tarojs/taro: 3.0.2 => 3.0.2
      @tarojs/webpack-runner: 3.0.2 => 3.0.2
      babel-preset-taro: 3.0.2 => 3.0.2
      eslint-config-taro: 3.0.2 => 3.0.2
      react: ^16.10.0 => 16.13.1
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Jul 10, 2020
@Chen-jj Chen-jj added the duplicate This issue or pull request already exists label Jul 17, 2020
@Chen-jj
Copy link
Contributor

Chen-jj commented Jul 17, 2020

duplicate of #6980

@Chen-jj Chen-jj closed this as completed Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants