If you get the following error when starting with your react native app
Application AwesomeProject has not been registered. This is either due to a require() error during initialization or failure to call AppRegistry.registerComponent.
You probably are following the react native tutorial here. When you past the code from the hello world example here your registered component name is not matching since you first one was AwesomeProject and the new one is HelloWorld.
Just change
AppRegistry.registerComponent( 'HelloWorldApp', () => HelloWorldApp );
to
AppRegistry.registerComponent( 'AwesomeProject', () => HelloWorldApp );
Hope you did not waste much time on this, good luck learning React Native
Thank you very much, everywhere most of the time answer is to close running multiple terminals for the server, but this obvious mistake had to happen to newbie
Yes, this is very common with almost any new framework,tool, language when you don’t know what is what.
Thank you! This was definitely helpful.
Thanks a lot 😀
Glad to help 🙂
Thank you! This was definitely helpful.
I did as you instructed, my react init was AwesomeProject, so i renamed the last bit, as follows
import React, { Component } from 'react';
import { AppRegistry, Text } from 'react-native';
class AwesomeProject extends Component {
render() {
return (
Hello world!
);
}
}
AppRegistry.registerComponent('AwesomeProject', () => HelloWorldApp);
//got the error
//could not connect to development server
//help
newbie
Run npm start on local machine to start the development server. React Native relies on a development server to communicate with the app running in the simulator.
close terminal and again start teminal.
Great man, helped me out a lot, thanks for this!