Gabriel (4) [Avatar] Offline
#1
Hi,
I'm new to React Native and I'm following the StarWars example (chapter 6). I took the code from the Github repo (copied & pasted the files) and I can't make it work. I get this error:

Application StarWarsApp has not been registered.
Hint: This error often happens when you're running the packager (local dev server) from a wrong folder. For example you have multiple apps and the packager is still running for the app you were working on before.
...


Is the code available in the repo correct?

Thank you,
Gabriel
287516 (27) [Avatar] Offline
#2
Hello! When you ran react-native-init, did you also name your project StarWarsApp ? Also, if you had an instance of the packager running previously, make sure you kill the packager.
Gabriel (4) [Avatar] Offline
#3
Hi,
following the book instructions I created the app from the command line: react-native init StarWarsApp. And then: react-native run-ios. As the app cannot run until all the components are coded, I took the code available on Github... but I got the error mentioned in my previous post. I realized that there's and error in index.ios.js:

GitHub file:
AppRegistry.registerComponent('StarWars', () => Navigation);

Should be:
AppRegistry.registerComponent('StarWarsApp', () => Navigation);


Examples are expected to run at once, aren't they? The code available on Github contains errors and has not been tested.

Apart from that, the example should be restructured in such a way that it should be possible to run it gradually as the explanation progresses (rather than having to write down the entire application code)

Regards,
Gabriel