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:
@@ -63,7 +63,7 @@ changes in the filesystem. It is highly recommended you install it for better pe
|
||||
</span><h3><a class="anchor" name="node"></a>Node <a class="hash-link" href="docs/getting-started.html#node">#</a></h3><p>We recommend installing Node.js and Python2 via <a href="https://chocolatey.org" target="_blank">Chocolatey</a>, a popular package manager for Windows. Open a Command Prompt as Administrator, then run:</p><div class="prism language-javascript">choco install nodejs<span class="token punctuation">.</span>install
|
||||
choco install python2</div><blockquote><p>You can find additional installation options on <a href="https://nodejs.org/en/download/" target="_blank">Node.js's Downloads page</a>.</p></blockquote><span><block class="mac ios android" />
|
||||
|
||||
</span><h3><a class="anchor" name="the-react-native-cli"></a>The React Native CLI <a class="hash-link" href="docs/getting-started.html#the-react-native-cli">#</a></h3><p>Node.js comes with npm, which lets you install the React Native command line interface.</p><span><block class="windows linux android" />
|
||||
</span><h3><a class="anchor" name="the-react-native-cli"></a>The React Native CLI <a class="hash-link" href="docs/getting-started.html#the-react-native-cli">#</a></h3><p>Node.js comes with npm, which lets you install the React Native command line interface.</p><p>Run the following command in a Terminal:</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>cli</div><span><block class="windows linux android" />
|
||||
|
||||
</span><h3><a class="anchor" name="the-react-native-cli"></a>The React Native CLI <a class="hash-link" href="docs/getting-started.html#the-react-native-cli">#</a></h3><p>Node.js comes with npm, which lets you install the React Native command line interface.</p><span><block class="mac ios android" />
|
||||
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
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="docs/upgrading.html#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>.</p><div class="prism language-javascript">$ npm install <span class="token operator">--</span>save react<span class="token operator">-</span>native@X<span class="token punctuation">.</span>Y
|
||||
# where X<span class="token punctuation">.</span>Y is the semantic version you are upgrading to</div><h2><a class="anchor" name="2-upgrade-your-project-templates"></a>2. Upgrade your project templates <a class="hash-link" href="docs/upgrading.html#2-upgrade-your-project-templates">#</a></h2><p>The new npm package may 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="docs/upgrading.html#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>:</p><div class="prism language-javascript">$ npm install <span class="token operator">--</span>save react<span class="token operator">-</span>native@X<span class="token punctuation">.</span>Y
|
||||
# where X<span class="token punctuation">.</span>Y is the semantic version you are upgrading to
|
||||
npm WARN peerDependencies The peer dependency react@<span class="token operator">~</span>R included from react<span class="token operator">-</span>native<span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span></div><p>If you saw a warning about the peerDependency, also upgrade <code>react</code> by running:</p><div class="prism language-javascript">$ npm install <span class="token operator">--</span>save react@R
|
||||
# where R is the <span class="token keyword">new</span> <span class="token class-name">version</span> of react from the peerDependency warning you saw</div><h2><a class="anchor" name="2-upgrade-your-project-templates"></a>2. Upgrade your project templates <a class="hash-link" href="docs/upgrading.html#2-upgrade-your-project-templates">#</a></h2><p>The new npm package may 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.</p><p>You may consult <a href="https://github.com/ncuillery/rn-diff" target="_blank">rn-diff</a> to see if there were changes in the project template files.
|
||||
In case there weren't any, simply rebuild the project and continue developing. In case of minor changes, you may update your project manually and rebuild.</p><p>If there were major changes, run this in a terminal to get these:</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