Thursday, January 17, 2019

Create Native App Tool



Its a new tool that makes it significantly easier to get started with a React Native project!

With Create React Native App, there’s no need to use Xcode or Android Studio, and you can develop for your iOS device using Linux or Windows.
This is accomplished using the Expo app, which loads and runs CRNA projects written in pure JavaScript without compiling any native code.

$ npm i -g create-react-native-app
$ create-react-native-app my-project
$ cd my-project
$ npm start

This will start the React Native packager and print a QR code. Open it in the Expo app to load your JavaScript. Calls to console.log are forwarded to your terminal. You can make use of any standard React Native APIs as well as the Expo SDK.

Native code with Create React Native

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.

Now with the above theory. Tried to create the project actually and below was the results

It asked whether require Expo CLI.
This command requires Expo CLI.
Do you want to install it globally [Y/n]? Y



References:
https://facebook.github.io/react-native/blog/2017/03/13/introducing-create-react-native-app

No comments:

Post a Comment