老师 0.71.8 版本 AppRegistry.registerComponent 被启用了 改成 registerRootComponent 结果报错
来源:16-7 React Native 混合开发实战(Android篇)-5【解锁新的开发方式】
szcatt
2023-06-20
Invariant Violation: “App2” has not been registered. This can happen if:
- Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
- A module failed to load due to an error and
AppRegistry.registerComponent
wasn’t called., js engine: hermes
写回答
1回答
-
CrazyCodeBoy
2023-06-20
registerRootComponent是用在expo上的,如果你没有用到expo的话直接用课程中的方式通过AppRegistry.registerComponent注册就好。052023-06-21
相似问题