mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Updated docs for next
This commit is contained in:
@@ -245,7 +245,7 @@ $ react<span class="token operator">-</span>native run<span class="token operato
|
||||
</span><p>You can examine the code that added the React Native screen on <a href="https://github.com/JoelMarcey/swift-2048/commit/13272a31ee6dd46dc68b1dcf4eaf16c1a10f5229" target="_blank">GitHub</a>.</p><span><block class="android" />
|
||||
|
||||
</span><h2><a class="anchor" name="add-js-to-your-app"></a>Add JS to your app <a class="hash-link" href="docs/integration-with-existing-apps.html#add-js-to-your-app">#</a></h2><p>In your app's root folder, run:</p><div class="prism language-javascript">$ npm init
|
||||
$ npm install <span class="token operator">--</span>save react<span class="token operator">-</span>native
|
||||
$ npm install <span class="token operator">--</span>save react react<span class="token operator">-</span>native
|
||||
$ curl <span class="token operator">-</span>o <span class="token punctuation">.</span>flowconfig https<span class="token punctuation">:</span><span class="token operator">/</span><span class="token operator">/</span>raw<span class="token punctuation">.</span>githubusercontent<span class="token punctuation">.</span>com<span class="token operator">/</span>facebook<span class="token operator">/</span>react<span class="token operator">-</span>native<span class="token regex">/master/</span><span class="token punctuation">.</span>flowconfig</div><p>This creates a node module for your app and adds the <code>react-native</code> npm dependency. Now open the newly created <code>package.json</code> file and add this under <code>scripts</code>:</p><div class="prism language-javascript"><span class="token string">"start"</span><span class="token punctuation">:</span> <span class="token string">"node node_modules/react-native/local-cli/cli.js start"</span></div><p>Copy & paste the following code to <code>index.android.js</code> in your root folder — it's a barebones React Native app:</p><div class="prism language-javascript"><span class="token string">'use strict'</span><span class="token punctuation">;</span>
|
||||
|
||||
import React from <span class="token string">'react'</span><span class="token punctuation">;</span>
|
||||
|
||||
Reference in New Issue
Block a user