mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
update website
This commit is contained in:
+1
-2
@@ -2,8 +2,7 @@
|
||||
and other goodies. Because React Native projects are essentially made up of an Android project, an
|
||||
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's what you need to do to upgrade from an older
|
||||
version of React Native:</p><h2><a class="anchor" name="1-upgrade-the-react-native-dependency"></a>1. Upgrade the <code>react-native</code> dependency <a class="hash-link" href="#1-upgrade-the-react-native-dependency">#</a></h2><p>Note the latest version of the <code>react-native</code> npm package from here:</p><ul><li><a href="https://www.npmjs.com/package/react-native">https://www.npmjs.com/package/react-native</a></li></ul><p>Open your <code>package.json</code> file and update the version of <code>react-native</code> under <code>dependencies</code> to the
|
||||
latest version. Now, in a terminal run:</p><div class="prism language-javascript">$ npm install</div><h2><a class="anchor" name="2-upgrade-your-project-templates"></a>2. Upgrade your project templates <a class="hash-link" href="#2-upgrade-your-project-templates">#</a></h2><p>The new npm package will likely contain updates to the files that are normally generated when you
|
||||
version of React Native:</p><h2><a class="anchor" name="1-upgrade-the-react-native-dependency"></a>1. Upgrade the <code>react-native</code> dependency <a class="hash-link" href="#1-upgrade-the-react-native-dependency">#</a></h2><p>Note the latest version of the <code>react-native</code> npm package from here (or use <code>npm info react-native</code> to check):</p><ul><li><a href="https://www.npmjs.com/package/react-native">https://www.npmjs.com/package/react-native</a></li></ul><p>Now install that version of <code>react-native</code> in your project with <code>npm install --save</code>. For example, to upgrade to the version <code>0.18</code>, in a terminal run:</p><div class="prism language-javascript">$ npm install <span class="token operator">--</span>save react<span class="token operator">-</span>native@<span class="token number">0.18</span></div><h2><a class="anchor" name="2-upgrade-your-project-templates"></a>2. Upgrade your project templates <a class="hash-link" href="#2-upgrade-your-project-templates">#</a></h2><p>The new npm package will likely contain updates to the files that are normally generated when you
|
||||
run <code>react-native init</code>, like the iOS and the Android sub-projects. To get these latest changes,
|
||||
run this in a terminal:</p><div class="prism language-javascript">$ react<span class="token operator">-</span>native upgrade</div><p>This will check your files against the latest template and perform the following:</p><ul><li>If there is a new file in the template, it is simply created.</li><li>If a file in the template is identical to your file, it is skipped.</li><li>If a file is different in your project than the template, you will be prompted; you have options
|
||||
to view a diff between your file and the template file, keep your file or overwrite it with the
|
||||
|
||||
Reference in New Issue
Block a user