5

On the official website we can read how to create new project:

create-react-native-app AwesomeProject

but on tutorials I always see:

react-native init AwesomeProject

What is the correct? What is the difference between them

github2017
  • 103
  • 1
  • 10
  • 1
    Did you do any research? Googling *"create-react-native-app vs react-native init"* found loads of resources, including a bunch of existing questions here (e.g. https://stackoverflow.com/q/45123576/3001761). – jonrsharpe Aug 06 '18 at 15:44

2 Answers2

7

One uses Expo and the other does not. With create-react-native-app you use Expo and native code is totally transparent to you.

With the typical react-native init, you get all the code and you can modify native code if you want (or write custom native modules).

You can find everything documented here: https://facebook.github.io/react-native/docs/getting-started.html

First tab, Quick start is about create-react-native-app, second tab Building Projects with Native Code is about react-native init.

Probably in most tutorials you find the react-native init option because that option is there from the very beginning while create-react-native-app is newer new utility.

Recommendation:

  1. If you know you will need to modify native code, use react-native init. If not, you can go with create-react-native-app
  2. Even if you go with create-react-native-app, if at some point your needs change, you can eject
Ferran Negre
  • 3,712
  • 3
  • 34
  • 56
1

Referencing EvanBacon's answer, react native init creates a purely react native app, whereas Facebook's create-react-native-app makes a project "bootstrapped with expo."

Novuw
  • 31
  • 5