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
Starting a new project You can use Expo or create-react-native-app (which in turns uses Expo-Cli) to start your new project, but with this method you are in more control of what happend in your projecto and can communicate, tweak and write your own modules with native libraries for iOS and Android mobile platform.
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:
react-native init
. If not, you can go with create-react-native-app
create-react-native-app
, if at some point your needs change, you can eject
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."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With