github2017
github2017

Reputation: 103

Creating new project ReactNative

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

Upvotes: 5

Views: 7425

Answers (2)

Ferran Negre
Ferran Negre

Reputation: 3801

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

Upvotes: 7

Novuw
Novuw

Reputation: 31

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."

Upvotes: 1

Related Questions