Updated docs for next

This commit is contained in:
Website Deployment Script
2017-04-07 18:30:46 +00:00
parent fe4e0278c4
commit 6757bc4d9d
3 changed files with 3 additions and 3 deletions
@@ -364,7 +364,7 @@ public boolean <span class="token function">onKeyUp<span class="token punctuatio
<span class="token keyword">return</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">return</span> super<span class="token punctuation">.</span><span class="token function">onKeyUp<span class="token punctuation">(</span></span>keyCode<span class="token punctuation">,</span> event<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span></div><p>Now your activity is ready to run some JavaScript code.</p><h3><a class="anchor" name="configure-permissions-for-development-error-overlay"></a>Configure permissions for development error overlay <a class="hash-link" href="docs/integration-with-existing-apps.html#configure-permissions-for-development-error-overlay">#</a></h3><p>If your app is targeting the Android <code>API level 23</code> or greater, make sure you have the <code>overlay</code> permission enabled for the development build. You can check it with <code>Settings.canDrawOverlays(this);</code>. This is required in dev builds because react native development errors must be displayed above all the other windows. Due to the new permissions system introduced in the API level 23, the user needs to approve it. This can be acheived by adding the following code to the Activity file in the onCreate() method. OVERLAY_PERMISSION_REQ_CODE is a field of the class which would be responsible for passing the result back to the Activity.</p><div class="prism language-javascript"><span class="token keyword">if</span> <span class="token punctuation">(</span>Build<span class="token punctuation">.</span>VERSION<span class="token punctuation">.</span>SDK_INT <span class="token operator">&gt;=</span> Build<span class="token punctuation">.</span>VERSION_CODES<span class="token punctuation">.</span>M<span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token punctuation">}</span></div><p>Now your activity is ready to run some JavaScript code.</p><h3><a class="anchor" name="configure-permissions-for-development-error-overlay"></a>Configure permissions for development error overlay <a class="hash-link" href="docs/integration-with-existing-apps.html#configure-permissions-for-development-error-overlay">#</a></h3><p>If your app is targeting the Android <code>API level 23</code> or greater, make sure you have the <code>overlay</code> permission enabled for the development build. You can check it with <code>Settings.canDrawOverlays(this);</code>. This is required in dev builds because react native development errors must be displayed above all the other windows. Due to the new permissions system introduced in the API level 23, the user needs to approve it. This can be achieved by adding the following code to the Activity file in the onCreate() method. OVERLAY_PERMISSION_REQ_CODE is a field of the class which would be responsible for passing the result back to the Activity.</p><div class="prism language-javascript"><span class="token keyword">if</span> <span class="token punctuation">(</span>Build<span class="token punctuation">.</span>VERSION<span class="token punctuation">.</span>SDK_INT <span class="token operator">&gt;=</span> Build<span class="token punctuation">.</span>VERSION_CODES<span class="token punctuation">.</span>M<span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>Settings<span class="token punctuation">.</span><span class="token function">canDrawOverlays<span class="token punctuation">(</span></span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
Intent intent <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Intent</span><span class="token punctuation">(</span>Settings<span class="token punctuation">.</span>ACTION_MANAGE_OVERLAY_PERMISSION<span class="token punctuation">,</span>
Uri<span class="token punctuation">.</span><span class="token function">parse<span class="token punctuation">(</span></span><span class="token string">&quot;package:&quot;</span> <span class="token operator">+</span> <span class="token function">getPackageName<span class="token punctuation">(</span></span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
+1 -1
View File
@@ -9,7 +9,7 @@ easy to debug.</p><p>Doesn&#x27;t yet support other contained responders from bl
view from becoming the responder.</p><p><code>&lt;ScrollView&gt;</code> vs <a href="/react-native/docs/flatlist.html" target=""><code>&lt;FlatList&gt;</code></a> - which one to use?</p><p><code>ScrollView</code> simply renders all its react child components at once. That
makes it very easy to understand and use.</p><p>On the other hand, this has a performance downside. Imagine you have a very
long list of items you want to display, maybe several screens worth of
content. Creating JS components and native views for everythign all at once,
content. Creating JS components and native views for everything all at once,
much of which may not even be shown, will contribute to slow rendering and
increased memory usage.</p><p>This is where <code>FlatList</code> comes into play. <code>FlatList</code> renders items lazily,
just when they are about to appear, and removes items that scroll way off
+1 -1
View File
@@ -3,7 +3,7 @@ and other goodies. Because React Native projects are essentially made up of an A
iOS project and a JavaScript project, all combined under an npm package, upgrading can be rather
tricky. But we try to make it easy for you. Here&#x27;s what you need to do to upgrade from an older
version of React Native:</p><h2><a class="anchor" name="upgrade-based-on-git"></a>Upgrade based on Git <a class="hash-link" href="docs/upgrading.html#upgrade-based-on-git">#</a></h2><p><strong>IMPORTANT:</strong> You don&#x27;t have to install the new version of React Native, it will be installed automatically.</p><p>The module <code>react-native-git-upgrade</code> provides a one-step operation to upgrade the source files with
a minimum of conflicts. Under the hood, it consists in 2 phases:</p><ul><li>First, it computes a Git patch between both old and new template files,</li><li>Then, the patch is applied on the user&#x27;s sources.</li></ul><h3><a class="anchor" name="1-install-git"></a>1. Install Git <a class="hash-link" href="docs/upgrading.html#1-install-git">#</a></h3><p>Your project doesn&#x27;t have to be handled by the Git versioning sytem (could be Mercurial, SVN or none)
a minimum of conflicts. Under the hood, it consists in 2 phases:</p><ul><li>First, it computes a Git patch between both old and new template files,</li><li>Then, the patch is applied on the user&#x27;s sources.</li></ul><h3><a class="anchor" name="1-install-git"></a>1. Install Git <a class="hash-link" href="docs/upgrading.html#1-install-git">#</a></h3><p>Your project doesn&#x27;t have to be handled by the Git versioning system (could be Mercurial, SVN or none)
but Git has to be installed and available in the <code>PATH</code>. You can download Git here:
<a href="https://git-scm.com/downloads">https://git-scm.com/downloads</a></p><h3><a class="anchor" name="2-install-the-react-native-git-upgrade-module"></a>2. Install the <code>react-native-git-upgrade</code> module <a class="hash-link" href="docs/upgrading.html#2-install-the-react-native-git-upgrade-module">#</a></h3><p>It&#x27;s a CLI tool and must be installed globally:</p><div class="prism language-javascript">$ npm install <span class="token operator">-</span>g react<span class="token operator">-</span>native<span class="token operator">-</span>git<span class="token operator">-</span>upgrade</div><h3><a class="anchor" name="3-run-the-command"></a>3. Run the command <a class="hash-link" href="docs/upgrading.html#3-run-the-command">#</a></h3><p>Run the command to start the process:</p><div class="prism language-javascript">$ react<span class="token operator">-</span>native<span class="token operator">-</span>git<span class="token operator">-</span>upgrade
# Upgrade React Native to the latest version