Button is meant to work great and look native on every platform, so it won't support all the bells and whistles that custom buttons do. It is a great starting point, but is not meant to replace all your existing buttons. To learn more, check out the new Button documentation, complete with a runnable example!
Speed up react-native init using Yarn
You can now use Yarn, the new package manager for JavaScript, to speed up react-native init significantly. To see the speedup please install yarn and upgrade your react-native-cli to 1.2.0:
-
$ npm install -g react-native-cli
+
$ npminstall -g react-native-cli
You should now see “Using yarn” when setting up new apps:
Button is meant to work great and look native on every platform, so it won't support all the bells and whistles that custom buttons do. It is a great starting point, but is not meant to replace all your existing buttons. To learn more, check out the new Button documentation, complete with a runnable example!
Speed up react-native init using Yarn
You can now use Yarn, the new package manager for JavaScript, to speed up react-native init significantly. To see the speedup please install yarn and upgrade your react-native-cli to 1.2.0:
-
$ npm install -g react-native-cli
+
$ npminstall -g react-native-cli
You should now see “Using yarn” when setting up new apps:
Today we’re announcing Create React Native App: a new tool that makes it significantly easier to get started with a React Native project! It’s heavily inspired by the design of Create React App and is the product of a collaboration between Facebook and Expo (formerly Exponent).
Many developers struggle with installing and configuring React Native’s current native build dependencies, especially for Android. With Create React Native App, there’s no need to use Xcode or Android Studio, and you can develop for your iOS device using Linux or Windows. This is accomplished using the Expo app, which loads and runs CRNA projects written in pure JavaScript without compiling any native code.
Try creating a new project (replace with suitable yarn commands if you have it installed):
-
$ npm i -g create-react-native-app
-$ create-react-native-appmy-project
-$ cd my-project
-$ npm start
-
+
$ npm i -g create-react-native-app
+$ create-react-native-app my-project
+$ cd my-project
+$ npm start
+
This will start the React Native packager and print a QR code. Open it in the Expo app to load your JavaScript. Calls to console.log are forwarded to your terminal. You can make use of any standard React Native APIs as well as the Expo SDK.
What about native code?
Many React Native projects have Java or Objective-C/Swift dependencies that need to be compiled. The Expo app does include APIs for camera, video, contacts, and more, and bundles popular libraries like Airbnb’s react-native-maps, or Facebook authentication. However if you need a native code dependency that Expo doesn’t bundle then you’ll probably need to have your own build configuration for it. Just like Create React App, “ejecting” is supported by CRNA.
Today we’re announcing Create React Native App: a new tool that makes it significantly easier to get started with a React Native project! It’s heavily inspired by the design of Create React App and is the product of a collaboration between Facebook and Expo (formerly Exponent).
Many developers struggle with installing and configuring React Native’s current native build dependencies, especially for Android. With Create React Native App, there’s no need to use Xcode or Android Studio, and you can develop for your iOS device using Linux or Windows. This is accomplished using the Expo app, which loads and runs CRNA projects written in pure JavaScript without compiling any native code.
Try creating a new project (replace with suitable yarn commands if you have it installed):
-
$ npm i -g create-react-native-app
-$ create-react-native-appmy-project
-$ cd my-project
-$ npm start
-
+
$ npm i -g create-react-native-app
+$ create-react-native-app my-project
+$ cd my-project
+$ npm start
+
This will start the React Native packager and print a QR code. Open it in the Expo app to load your JavaScript. Calls to console.log are forwarded to your terminal. You can make use of any standard React Native APIs as well as the Expo SDK.
What about native code?
Many React Native projects have Java or Objective-C/Swift dependencies that need to be compiled. The Expo app does include APIs for camera, video, contacts, and more, and bundles popular libraries like Airbnb’s react-native-maps, or Facebook authentication. However if you need a native code dependency that Expo doesn’t bundle then you’ll probably need to have your own build configuration for it. Just like Create React App, “ejecting” is supported by CRNA.
The tsconfig.json file contains all the settings for the TypeScript compiler. The defaults created by the command above are mostly fine, but open the file and uncomment the following line:
As a checkpoint, consider committing your files into version control.
-
git init
-git add .gitignore # import to do this first, to ignore our files
-git add .
-git commit -am "Initial commit."
+
git init
+gitadd .gitignore # import to do this first, to ignore our files
+gitadd.
+git commit -am "Initial commit."
Adding a Component
Let's add a component to our app. Let's go ahead and create a Hello.tsx component. It's a pedagogical component, not something that you'd actually write in an app, but something nontrivial that shows off how to use TypeScript in React Native.
Now that we've got a component, let's try testing it.
We already have Jest installed as a test runner. We're going to write snapshot tests for our components, let's add the required add-on for snapshot tests:
-
yarn add --dev react-addons-test-utils
+
yarnadd --dev react-addons-test-utils
Now let's create a __tests__ folder in the components directory and add a test for Hello.tsx:
The tsconfig.json file contains all the settings for the TypeScript compiler. The defaults created by the command above are mostly fine, but open the file and uncomment the following line:
As a checkpoint, consider committing your files into version control.
-
git init
-git add .gitignore # import to do this first, to ignore our files
-git add .
-git commit -am "Initial commit."
+
git init
+gitadd .gitignore # import to do this first, to ignore our files
+gitadd.
+git commit -am "Initial commit."
Adding a Component
Let's add a component to our app. Let's go ahead and create a Hello.tsx component. It's a pedagogical component, not something that you'd actually write in an app, but something nontrivial that shows off how to use TypeScript in React Native.
Now that we've got a component, let's try testing it.
We already have Jest installed as a test runner. We're going to write snapshot tests for our components, let's add the required add-on for snapshot tests:
-
yarn add --dev react-addons-test-utils
+
yarnadd --dev react-addons-test-utils
Now let's create a __tests__ folder in the components directory and add a test for Hello.tsx:
The tsconfig.json file contains all the settings for the TypeScript compiler. The defaults created by the command above are mostly fine, but open the file and uncomment the following line:
As a checkpoint, consider committing your files into version control.
-
git init
-git add .gitignore # import to do this first, to ignore our files
-git add .
-git commit -am "Initial commit."
+
git init
+gitadd .gitignore # import to do this first, to ignore our files
+gitadd.
+git commit -am "Initial commit."
Adding a Component
Let's add a component to our app. Let's go ahead and create a Hello.tsx component. It's a pedagogical component, not something that you'd actually write in an app, but something nontrivial that shows off how to use TypeScript in React Native.
Now that we've got a component, let's try testing it.
We already have Jest installed as a test runner. We're going to write snapshot tests for our components, let's add the required add-on for snapshot tests:
-
yarn add --dev react-addons-test-utils
+
yarnadd --dev react-addons-test-utils
Now let's create a __tests__ folder in the components directory and add a test for Hello.tsx:
Today we’re announcing Create React Native App: a new tool that makes it significantly easier to get started with a React Native project! It’s heavily inspired by the design of Create React App and is the product of a collaboration between Facebook and Expo (formerly Exponent).
Many developers struggle with installing and configuring React Native’s current native build dependencies, especially for Android. With Create React Native App, there’s no need to use Xcode or Android Studio, and you can develop for your iOS device using Linux or Windows. This is accomplished using the Expo app, which loads and runs CRNA projects written in pure JavaScript without compiling any native code.
Try creating a new project (replace with suitable yarn commands if you have it installed):
-
$ npm i -g create-react-native-app
-$ create-react-native-appmy-project
-$ cd my-project
-$ npm start
-
+
$ npm i -g create-react-native-app
+$ create-react-native-app my-project
+$ cd my-project
+$ npm start
+
This will start the React Native packager and print a QR code. Open it in the Expo app to load your JavaScript. Calls to console.log are forwarded to your terminal. You can make use of any standard React Native APIs as well as the Expo SDK.
What about native code?
Many React Native projects have Java or Objective-C/Swift dependencies that need to be compiled. The Expo app does include APIs for camera, video, contacts, and more, and bundles popular libraries like Airbnb’s react-native-maps, or Facebook authentication. However if you need a native code dependency that Expo doesn’t bundle then you’ll probably need to have your own build configuration for it. Just like Create React App, “ejecting” is supported by CRNA.
diff --git a/blog/page4/index.html b/blog/page4/index.html
index f6616c805ed..d888be1139d 100644
--- a/blog/page4/index.html
+++ b/blog/page4/index.html
@@ -182,7 +182,7 @@ index e98ebb0..2fb6a11 new Button documentation, complete with a runnable example!
Speed up react-native init using Yarn
You can now use Yarn, the new package manager for JavaScript, to speed up react-native init significantly. To see the speedup please install yarn and upgrade your react-native-cli to 1.2.0:
-
$ npm install -g react-native-cli
+
$ npminstall -g react-native-cli
You should now see “Using yarn” when setting up new apps:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.10/running-on-device.html b/docs/0.10/running-on-device.html
index 5473e5332c8..0196b17058b 100644
--- a/docs/0.10/running-on-device.html
+++ b/docs/0.10/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.11/running-on-device.html b/docs/0.11/running-on-device.html
index 88d8051fed4..9325d1888da 100644
--- a/docs/0.11/running-on-device.html
+++ b/docs/0.11/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.12/running-on-device.html b/docs/0.12/running-on-device.html
index 8dc2a4c516f..afa957d732a 100644
--- a/docs/0.12/running-on-device.html
+++ b/docs/0.12/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.13/running-on-device.html b/docs/0.13/running-on-device.html
index e11716962a6..fcbfe748e9e 100644
--- a/docs/0.13/running-on-device.html
+++ b/docs/0.13/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.14/running-on-device.html b/docs/0.14/running-on-device.html
index 7a8e201aff4..3ba11d6d318 100644
--- a/docs/0.14/running-on-device.html
+++ b/docs/0.14/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.15/running-on-device.html b/docs/0.15/running-on-device.html
index b50db63d947..381626c49e0 100644
--- a/docs/0.15/running-on-device.html
+++ b/docs/0.15/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.16/running-on-device.html b/docs/0.16/running-on-device.html
index 5d830ff48b2..2fdb228a830 100644
--- a/docs/0.16/running-on-device.html
+++ b/docs/0.16/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.17/running-on-device.html b/docs/0.17/running-on-device.html
index db7808ced02..f823547dd66 100644
--- a/docs/0.17/running-on-device.html
+++ b/docs/0.17/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.18/running-on-device.html b/docs/0.18/running-on-device.html
index 9ec065b08db..d2b0f25d092 100644
--- a/docs/0.18/running-on-device.html
+++ b/docs/0.18/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.19/running-on-device.html b/docs/0.19/running-on-device.html
index 50514faff12..9e1f41f5bbd 100644
--- a/docs/0.19/running-on-device.html
+++ b/docs/0.19/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
You may specify a React Native version by passing an argument, e.g. to upgrade to 0.61.0-rc.0 run:
-
react-native upgrade 0.61.0-rc.0
+
react-native upgrade 0.61.0-rc.0
The project is upgraded using git apply with 3-way merge, it may happen that you'll need to resolve a few conflicts after it's finished.
2. Resolve the conflicts
@@ -118,9 +118,9 @@
💡 Major updates will show an "useful content" section on the top with links to help you out when upgrading.
2. Upgrade dependencies
The first file that is shown is the package.json, it's good to update the dependencies that are showing in there. For example, if react-native and react appears as changes then you can install it in your project by running yarn add:
-
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
-yarn add react-native@{{VERSION}}
-yarn add react@{{REACT_VERSION}}
+
# {{VERSION}} and {{REACT_VERSION}} are the release versions showing in the diff
+yarnadd react-native@{{VERSION}}
+yarnadd react@{{REACT_VERSION}}
3. Upgrade your project files
The new release may contain updates to other files that are generated when you run react-native init, those files are listed after the package.json in the Upgrade Helper page. If there aren't other changes then you can rebuild the project and continue developing.
I want to upgrade with React Native CLI but I don't use Git
While your project does not have to be handled by the Git versioning system -- you can use Mercurial, SVN, or nothing -- you will still need to install Git on your system in order to use react-native upgrade. Git will also need to be available in the PATH. If your project doesn't use Git, initialize it and commit:
-
git init # Initialize a Git repository
-git add . # Stage all the current files
-git commit -m "Upgrade react-native"# Save the current files in a commit
+
git init # Initialize a Git repository
+gitadd.# Stage all the current files
+git commit -m "Upgrade react-native"# Save the current files in a commit
After you finish upgrading you may remove the .git directory.
I have done all the changes but my app is still using an old version
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
The second step is to install the required peer dependencies. You need to run different commands depending on whether your projects is an Expo managed project or a bare React Native project.
If you have an Expo managed project, install the dependencies with expo:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
Native-specific extensions (i.e. sharing code with NodeJS and Web)
You can also use the .native.js extension when a module needs to be shared between NodeJS/Web and React Native but it has no Android/iOS differences. This is specially useful for projects that has common code shared among React Native and ReactJS.
For example, say you have the following files in your project:
-
Container.js # picked up by Webpack, Rollup or any other Web bundler
-Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
+
Container.js # picked up by Webpack, Rollup or any other Web bundler
+Container.native.js # picked up by the React Native bundler for both Android and iOS (Metro)
You can still require it without the .native extension, as follows:
import Container from'./Container';
diff --git a/docs/0.20/running-on-device.html b/docs/0.20/running-on-device.html
index fecba4554c9..de7072778fb 100644
--- a/docs/0.20/running-on-device.html
+++ b/docs/0.20/running-on-device.html
@@ -143,7 +143,7 @@ Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
22b8:2e76
In this case, it's 22b8. That's the identifier for Motorola.
You'll need to input this into your udev rules in order to get up and running:
-
echo'SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/51-android-usb.rules
+
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.
Gradle's bundleRelease will bundle all the JavaScript needed to run your app into the AAB (Android App Bundle). If you need to change the way the JavaScript bundle and/or drawable resources are bundled (e.g. if you changed the default file/folder names or the general structure of the project), have a look at android/app/build.gradle to see how you can update it to reflect these changes.
@@ -135,7 +135,7 @@ $ ./gradlew bundleRelease
Note: In order for Google Play to accept AAB format the App Signing by Google Play needs to be configured for your application on the Google Play Console. If you are updating an existing app that doesn't use App Signing by Google Play, please check our migration section to learn how to perform that configuration change.
Testing the release build of your app
Before uploading the release build to the Play Store, make sure you test it thoroughly. First uninstall any previous version of the app you already have installed. Install it on the device using:
-
$ react-native run-android --variant=release
+
$ react-native run-android --variant=release
Note that --variant=release is only available if you've set up signing as described above.
You can kill any running packager instances, since all your framework and JavaScript code is bundled in the APK's assets.