Learning React Native – Part One

I am now trying to learn react-native from the book Learning React Native.

These are my notes that may help other people following this path.

First problem:

You can’t use npm 5 with create-react-native-app.

This can be resolved by using

npm install -g npm@4.6.1

This will roll npm back to a known good version. Later versions may work (and by the time you read this (it’s April 2018 as I write this) things may have moved on.

 

Note that you will also need to install the Expo app onto your phone.

The phone and your machine need to be on the same network.

This is for the first version of the app that was deployed.

There is also a react-native-cli version, but that requires a more complex android setup.

If you are using Expo it has a built in QR reader.

You may also need to register your own api code to use openweathermap.org.

It’s a bad idea to publish a public key for a free service.

So far this book seems less professionally written than the pragprog
 books that I have been working through recently. 
It does not seem to flow well and has a few rough edges. 
Typically code is added piecemeal but requires style details that 
are not supplied until the full sample.

The weather app is slightly broken. Image can no longer have children. There was no stated version of create-react-native-app so I have installed the latest.

That’s it for now – just finished Chapter 3

Note this is the end of this series of articles. The book was found to have so many broken examples that it was not worth continuing.

Linux Development on Android

It is now possible to start Linux Development on an android device:

https://medium.freecodecamp.org/building-a-node-js-application-on-android-part-1-termux-vim-and-node-js-dfa90c28958f

The above article shows how to install enough onto your phone to allow basic development.

Here is some of the history from my first session

1 apt update && apt upgrade
2 apt install coreutils
8 which awk
9 which sed
10 which grep
11 which curl

# not found so installed via
12 pkg install curl
13 curl
19 apt install vim
21 apt install nodejs
22 which node
24 node -v
25 history

Given that I now have node, vim, curl, grep, awk and sed this looks to be a useful base platform.