Introducing Create React Native App
Today we’re announcing Create React Native App: a new tool that makes it significantly easier to get started with a React Native project! It’s heavily inspired by the design of Create React App and is the product of a collaboration between Facebook and Expo (formerly Exponent).
Try creating a new project (replace with suitable yarn commands if you have it installed):
$ npm i -g create-react-native-app $ create-react-native-app my-project $ cd my-project $ npm start
console.log are forwarded to your terminal. You can make use of any standard React Native APIs as well as the Expo SDK.
What about native code?
Many React Native projects have Java or Objective-C/Swift dependencies that need to be compiled. The Expo app does include APIs for camera, video, contacts, and more, and bundles popular libraries like Airbnb’s react-native-maps, or Facebook authentication. However if you need a native code dependency that Expo doesn’t bundle then you’ll probably need to have your own build configuration for it. Just like Create React App, “ejecting” is supported by CRNA.
You can run
npm run eject to get a project very similar to what
react-native init would generate. At that point you’ll need Xcode and/or Android Studio just as you would if you started with
react-native init , adding libraries with
react-native link will work, and you’ll have full control over the native code compilation process.
Create React Native App is now stable enough for general use, which means we’re very eager to hear about your experience using it! You can find me on Twitter or open an issue on the GitHub repository. Pull requests are very welcome!