React-Native:应用程序尚未注册错误 [英] React-Native: Application has not been registered error

查看:77
本文介绍了React-Native:应用程序尚未注册错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在阅读React-Native教程.我从入门教程开始,在该教程中,我创建了一个新的react native项目,并成功地在设备上运行了该项目.

I am currently going through the React-Native tutorials. I began with the Getting Started tutorial, where I made a new react native project and successfully managed to run the project on my device.

然后我开始了道具教程,我复制了代码片段并尝试再次运行该项目,并在屏幕上显示以下错误消息:

I then started the Props tutorial, I copied the code snippet and tried to run the project again and had the following error message show up on my screen:

推荐答案

我认为这是由于项目名称与您注册的组件不匹配而导致的错误.

I guess it is an error caused by not matching name of project and your registered component.

您已经使用一个名称(即

You have inited project with one name, i.e.

react-native init AwesomeApp

但是在index.ios.js文件中,您注册了其他组件

But in your index.ios.js file you register other component

AppRegistry.registerComponent('Bananas', () => Bananas);

必须必须出现时

AppRegistry.registerComponent('AwesomeApp', () => Bananas);

如果您的组件名称确实匹配,请确保您没有在其他终端中运行任何其他react-native/node进程.

If your component name does match, ensure you don't have any other react-native/node process running in another terminal.

这篇关于React-Native:应用程序尚未注册错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆