taro icon indicating copy to clipboard operation
taro copied to clipboard

项目用RN编译后在expo中出错

Open YuanQuan opened this issue 8 years ago • 9 comments

版本:1.0.0 -beta.24 命令:npm run build:rn -- --watch 编译过程无报错,编译依赖文件都是最新的(删除了node_modules,重新执行install) 在IOS模拟器的Expo中报错。 错误内容大致为: Invariant Violation:Element type is invalid:expected a string(for built-in compontents) or a class/function (for composite components) but got :object Check the render method of 'ExpoRootComponent'.

This error is located at:in RootErrorBoundary(at registerRootComponent.js:34) in ExpoRootCpmpoent (at renderApplication.js:33) in RCTView (at View.js:60) in View (at AppContainer.js:122) in AppContainer(at renderApplication.js:32)

YuanQuan avatar Sep 06 '18 10:09 YuanQuan

选择的是默认模版,对吧。 @YuanQuan

Pines-Cheng avatar Sep 06 '18 10:09 Pines-Cheng

是的

YuanQuan avatar Sep 07 '18 02:09 YuanQuan

image 群里有人反馈同样的问题,这是错误截图。

原因是在初始化项目的时候选择了 TypeScript ,而 TypeScript RN 端现在还不支持。你看看是不是同样的原因。 @YuanQuan

Pines-Cheng avatar Sep 07 '18 03:09 Pines-Cheng

@YuanQuan 问题解决了吗?

Pines-Cheng avatar Sep 10 '18 01:09 Pines-Cheng

@Pines-Cheng TS现在是支持了吗,我这边希望在TS环境下运行RN的

YuanQuan avatar Sep 10 '18 05:09 YuanQuan

RN 端还没有,在计划列表中。 @YuanQuan

Pines-Cheng avatar Sep 10 '18 06:09 Pines-Cheng

@YuanQuan RN 端 TS 已支持 8ef6560589c994cea1b213c2d214caf35eb143a1

Pines-Cheng avatar Sep 19 '18 10:09 Pines-Cheng

@Pines-Cheng 建议文档更新一下,现在文档依然为:Note: React Native 端暂时还未支持 TypeScript,在初始化项目时,如果要考虑 RN 端,请不要选择 TypeScript。 辛苦了~

hnsxxscyx avatar Oct 23 '18 02:10 hnsxxscyx

已更新,多谢!🙏@hnsxxscyx

Pines-Cheng avatar Oct 23 '18 09:10 Pines-Cheng