diff --git a/docs/embedded-app-ios.html b/docs/embedded-app-ios.html index 5858191ba1e..26404b96ffa 100644 --- a/docs/embedded-app-ios.html +++ b/docs/embedded-app-ios.html @@ -1,4 +1,4 @@ -React Native | A framework for building native apps using React

Integrating with Existing Apps (iOS)

Since React makes no assumptions about the rest of your technology stack – it’s commonly noted as simply the V in MVC – it’s easily embeddable within an existing non-React Native app. In fact, it integrates with other best practice community tools like CocoaPods.

Requirements #

  • CocoaPodsgem install cocoapods
  • io.jsbrew install iojs && brew link iojs --force or from nvm
    • You may have to run brew unlink node if you have previously installed Node

Install React Native Using CocoaPods #

CocoaPods is a package management tool for iOS/Mac development. We need to use it to download React Native. If you haven't installed CocoaPods yet, check out this tutorial.

When you are ready to work with CocoaPods, add the following line to Podfile. If you don't have one, then create it under the root directory of your project.

pod 'React' +React Native | A framework for building native apps using React

Integrating with Existing Apps (iOS)

Since React makes no assumptions about the rest of your technology stack – it’s commonly noted as simply the V in MVC – it’s easily embeddable within an existing non-React Native app. In fact, it integrates with other best practice community tools like CocoaPods.

Requirements #

  • CocoaPodsgem install cocoapods
  • io.js
    • With nvm: Install nvm with its setup instructions here. Then run nvm install iojs && nvm alias default iojs, which installs the latest version of io.js and sets up your terminal so that typing node runs io.js. With nvm you can install multiple versions of Node and io.js and easily switch between them.
    • With Homebrew: Run brew install iojs && brew link iojs --force. You may need to run brew unlink node if you have previously installed Node.

Install React Native Using CocoaPods #

CocoaPods is a package management tool for iOS/Mac development. We need to use it to download React Native. If you haven't installed CocoaPods yet, check out this tutorial.

When you are ready to work with CocoaPods, add the following line to Podfile. If you don't have one, then create it under the root directory of your project.

pod 'React' pod 'React/RCTText' # Add any subspecs you want to use in your project

Remember to install all subspecs you need. The <Text> element cannot be used without pod 'React/RCTText'.

Then install your pods:

$ pod install

Create Your React Native App #

There are two pieces you’ll need to set up:

  1. The root JavaScript file that will contain your actual React Native app and other components
  2. Wrapper Objective-C code that will load up your script and create a RCTRootView to display and manage your React Native components

First, create a directory for your app’s React code and create a simple index.ios.js file:

$ mkdir ReactComponent $ touch ReactComponent/index.ios.js

Copy & paste following starter code for index.ios.js – it’s a barebones React Native app:

'use strict'; diff --git a/docs/getting-started.html b/docs/getting-started.html index 7951cee54bf..bfdb9e5958b 100644 --- a/docs/getting-started.html +++ b/docs/getting-started.html @@ -1,4 +1,4 @@ -React Native | A framework for building native apps using React

Getting Started

Requirements #

  1. OS X - This repo only contains the iOS (7+) implementation right now, and Xcode only runs on Mac.
  2. Xcode 6.3 or higher is recommended.
  3. Homebrew is the recommended way to install node, watchman, and flow.
  4. brew install iojs && brew link iojs --force. You may need to run brew unlink node if you have previously installed Node. New to io.js or npm?
  5. brew install watchman. We recommend installing watchman, otherwise you might hit a node file watching bug.
  6. brew install flow. If you want to use flow.

Quick start #

  • npm install -g react-native-cli
  • react-native init AwesomeProject

In the newly created folder AwesomeProject/

  • Open AwesomeProject.xcodeproj and hit run in Xcode.
  • Open index.ios.js in your text editor of choice and edit some lines.
  • Hit cmd+R in your iOS simulator to reload the app and see your change!

Congratulations! You've just successfully run and modified your first React Native app.

If you run into any issues getting started, see the troubleshooting page.

© 2015 Facebook Inc.

Getting Started

Requirements #

  1. OS X - This repo only contains the iOS (7+) implementation right now, and Xcode only runs on Mac.
  2. Xcode 6.3 or higher is recommended.
  3. Homebrew is the recommended way to install io.js, watchman, and flow.
  4. Install io.js 1.0 or newer. io.js is the modern version of Node.
    • With nvm: Install nvm with its setup instructions here. Then run nvm install iojs && nvm alias default iojs, which installs the latest version of io.js and sets up your terminal so that typing node runs io.js. With nvm you can install multiple versions of Node and io.js and easily switch between them.
    • With Homebrew: Run brew install iojs && brew link iojs --force. You may need to run brew unlink node if you have previously installed Node.
    • New to npm?
  5. brew install watchman. We recommend installing watchman, otherwise you might hit a node file watching bug.
  6. brew install flow. If you want to use flow.

We recommend periodically running brew update && brew upgrade to keep your programs up-to-date.

Quick start #

  • npm install -g react-native-cli
  • react-native init AwesomeProject

In the newly created folder AwesomeProject/

  • Open AwesomeProject.xcodeproj and hit run in Xcode.
  • Open index.ios.js in your text editor of choice and edit some lines.
  • Hit cmd+R in your iOS simulator to reload the app and see your change!

Congratulations! You've just successfully run and modified your first React Native app.

If you run into any issues getting started, see the troubleshooting page.

© 2015 Facebook Inc.