Creating our first React Native Application
In this recipe, we are going to build a React Native application and understand the main differences between React and React Native.
Getting Ready
To create our new React Native application, we need to install the react-native-cli
package:
npm install -greact-native-cli
How to do it...
Now, to create our first app:
- Let's do it with this command:
react-native init MyFirstReactNativeApp
- After we built our React Native app, we need to install Watchman, which is a file-watching service required by React Native. To install it, go to https://facebook.github.io/watchman/docs/install.html and download the latest version for your OS (Windows, Mac, or Linux).
- In this case, we are going to use Homebrew to install it for Mac. If you don't have Homebrew, you can install it with this command:
/usr/bin/ruby -e"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- To install Watchman, you need to run:
brew update brew install watchman
- To...