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.memo的组件编译成小程序出错 #3527

Closed
lbb00 opened this issue Jun 25, 2019 · 3 comments
Closed

使用了Taro.memo的组件编译成小程序出错 #3527

lbb00 opened this issue Jun 25, 2019 · 3 comments

Comments

@lbb00
Copy link

lbb00 commented Jun 25, 2019

问题描述

使用了Taro.memo的hooks组件编译成小程序出错,编译为h5没有问题.

复现步骤

const PlayerList = Taro.memo(props => (<View />))
export default PlayerList

报错信息

错误  组件错误  组件PlayerList路径错误,请检查!(可能原因是导出的组件名不正确)
错误  页面编译  页面/Users/onelong/work/ilisten-taro-pack/src/pages/playing/index编译失败!
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type object
    at assertPath (path.js:39:11)
    at Object.relative (path.js:1171:5)
    at pageDepComponents.forEach.depComponent (/usr/local/lib/node_modules/@tarojs/cli/dist/mini/page.js:172:84)
    at Array.forEach (<anonymous>)
    at componentMap.forEach.component (/usr/local/lib/node_modules/@tarojs/cli/dist/mini/page.js:163:47)
    at Array.forEach (<anonymous>)
    at realComponentsPathList.forEach.component (/usr/local/lib/node_modules/@tarojs/cli/dist/mini/page.js:162:54)
    at Array.forEach (<anonymous>)
    at /usr/local/lib/node_modules/@tarojs/cli/dist/mini/page.js:159:40
    at Generator.next (<anonymous>)

系统信息

Taro v1.3.3

@taro-bot
Copy link

taro-bot bot commented Jun 25, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@yuche
Copy link
Contributor

yuche commented Jun 25, 2019

Memo 只能传入一个函数式组件的引用

@lbb00
Copy link
Author

lbb00 commented Jun 25, 2019

了解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants