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

Taro.Component无法被继承 #9571

Closed
guwan opened this issue Jun 19, 2021 · 1 comment
Closed

Taro.Component无法被继承 #9571

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

Comments

@guwan
Copy link

guwan commented Jun 19, 2021

相关平台

微信小程序

复现仓库

https://gitee.com/wu6789/KnosApp.git
小程序基础库: 3.2.12
使用框架: React

复现步骤

class AddressPicker extends Taro.Component {
constructor() {
super(...arguments)
}

render () {
return (

测试

)
}
}
使用就会报错,改成React.Component 就不报错,版本是3.2.12,issue里面选不了版本
class AddressPicker extends Taro.Component {
constructor() {
super(...arguments)
}

render () {
return (

测试

)
}
}

期望结果

正常显示测试

实际结果

appservice?t=1624039925152:8162 pages/index/index.js:
TypeError: Super expression must either be null or a function
at _inherits (inherits.js:4)
at index.tsx:10
at Object../src/components/Test/index.tsx (index.tsx:10)
at webpack_require (bootstrap:79)
at Object../node_modules/babel-loader/lib/index.js!./src/pages/index/index.tsx (index.js:26)
at webpack_require (bootstrap:79)
at Module../src/pages/index/index.tsx (index.tsx?aff8:1)
at webpack_require (bootstrap:79)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)(env: Windows,mp,1.05.2105170; lib: 2.0.4)

环境信息

Taro v3.2.12


  Taro CLI 3.2.12 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 14.0.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-weapp Target - 编译到微信小程序 V-3 Version - 3.x labels Jun 19, 2021
@Chen-jj
Copy link
Contributor

Chen-jj commented Jun 21, 2021

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