-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
在React项目中import @tarojs/components, 会报组件undefined的错误 #6883
Comments
@AlvinYuXT 先 alias 一下
|
alias之后会缺少web component的定义的。目前找到了一个hack的方法解决,手动把web component注册进去 |
@AlvinYuXT 你好 请问一下 |
|
@AlvinYuXT 感谢大佬的指点 不过我发现 applyPolyfills().then(() => {
defineCustomElements(window, {
resourcesUrl: 'http://localhost:8080/static/'
})
}) |
@AlvinYuXT @craig00 大佬们探索好了之后欢迎给 Taro 文档贡献 React 项目使用 taro 组件库的最佳实践哈~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
H5
复现仓库
https://codesandbox.io/s/black-http-zj956?file=/src/App.js
浏览器版本: Chrome 83
使用框架: React
复现步骤
期望结果
正确的渲染View组件
实际结果
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
环境信息
补充信息
import { View } from '@tarojs/components/dist-h5',不会报undefined的错,但是缺少了web component的实现
The text was updated successfully, but these errors were encountered: