项目用RN编译后在expo中出错
版本: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
是的
群里有人反馈同样的问题,这是错误截图。
原因是在初始化项目的时候选择了 TypeScript ,而 TypeScript RN 端现在还不支持。你看看是不是同样的原因。 @YuanQuan
@YuanQuan 问题解决了吗?
@Pines-Cheng TS现在是支持了吗,我这边希望在TS环境下运行RN的
RN 端还没有,在计划列表中。 @YuanQuan
@YuanQuan RN 端 TS 已支持 8ef6560589c994cea1b213c2d214caf35eb143a1
@Pines-Cheng 建议文档更新一下,现在文档依然为:Note: React Native 端暂时还未支持 TypeScript,在初始化项目时,如果要考虑 RN 端,请不要选择 TypeScript。 辛苦了~
已更新,多谢!🙏@hnsxxscyx