taro-ui icon indicating copy to clipboard operation
taro-ui copied to clipboard

taro3+react+typescript的使用模式 taroui所有组件使用都引发ts报错,例如““AtAvatar”不能用作 JSX 组件”

Open Lucialiuxi opened this issue 2 years ago • 7 comments

问题描述 taro+react+typescript的使用模式 taroui所有组件使用都引发ts报错,例如““AtAvatar”不能用作 JSX 组件”

复现步骤 1.taro3创建项目 选择使用react typescript 2. 安装taro-ui,引用组件并使用到代码中 【无论是class还是function中都会引发ts报错】

代码 截屏2022-04-14 17 12 36

期望行为 能修复ts报错

报错信息 截屏2022-04-14 17 13 24

系统信息 截屏2022-04-14 17 17 38

Lucialiuxi avatar Apr 14 '22 09:04 Lucialiuxi

欢迎提交 Issue~

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

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

Good luck and happy coding~

taro-ui-bot[bot] avatar Apr 14 '22 09:04 taro-ui-bot[bot]

这个解决了吗?

lw664256297 avatar May 09 '22 10:05 lw664256297

很神奇,yarn报错,npm不报错,只能理解成对于不固定版本的包,两者安装的版本有差异

HandsomeOrDie avatar Jun 28 '22 06:06 HandsomeOrDie

同样遇到,怎么解决?

wangzhen-CHN avatar Oct 08 '22 03:10 wangzhen-CHN

同样遇到,怎么解决?

taro3.0的话taro-ui 也要3.0以上才行 npm i [email protected]

MrLinJingxing avatar Oct 08 '22 09:10 MrLinJingxing

同样遇到

zzcan avatar Oct 30 '22 07:10 zzcan

还没解决吗?

shenxiang216 avatar Apr 16 '23 01:04 shenxiang216

解决了 吐了 taro-ui升级到3.x版本就行了

shenxiang216 avatar Apr 16 '23 13:04 shenxiang216