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

@Next.RC.2版本无法使用函数式组件作为入口 报错Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s%s #6517

Closed
johnzgit opened this issue May 29, 2020 · 0 comments
Assignees
Milestone

Comments

@johnzgit
Copy link

问题描述

复现步骤

app.ts中返回一个函数式组件 例如

export default ({ children }) => children;

就可以收到报错

VM109: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 `AppWrapper`. 
    in lib_src_app (created by AppWrapper)
    in AppWrapper

期望行为

报错信息

系统信息

补充信息

如果您有功能上的建议,可以提到 FeatHub

使用上的问题,欢迎在「Taro 社区」一起交流

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

3 participants