The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Gabriel (10) [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 (45) [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 (10) [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