How to do it...

There are three ways to set up a RN application: completely manually, which you won't want to do; secondly, with packages, using the react-native-cli command-line interface; or lastly, by using a package very similar to what we already used for React, create-react-native-app (from now on, we'll refer to this as CRAN). A key difference between the two packages is that with the latter, you cannot include custom native modules, and if you need to do so, you'll have to eject the project, which will also require setting up several other tools.

You can read more about the two latter methods at https://facebook.github.io/react-native/docs/getting-started.html, and if you want to be prepared for ejecting, go to https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md.

We start by getting a command-line utility, which will include plenty of other packages:

npm install create-react-native-app -g

Afterwards, we can create and run a simple project with just three commands:

create-react-native-app yourprojectname
cd yourprojectname
npm start

You're set! Let's see how it works—and yes, we still have some more configuration to do, but it's good to check whether things are going well so far.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset