diff --git a/website/versioned_docs/version-0.70/_getting-started-linux-android.md b/website/versioned_docs/version-0.70/_getting-started-linux-android.md
new file mode 100644
index 00000000000..839c6882c65
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_getting-started-linux-android.md
@@ -0,0 +1,177 @@
+import RemoveGlobalCLI from './\_remove-global-cli.md';
+
+## Installing dependencies
+
+You will need Node, the React Native command line interface, a JDK, and Android Studio.
+
+While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.
+
+
Node
+
+Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 14 or newer.
+
+
Java Development Kit
+
+React Native currently recommends version 11 of the Java SE Development Kit (JDK). You may encounter problems using higher JDK versions. You may download and install [OpenJDK](http://openjdk.java.net) from [AdoptOpenJDK](https://adoptopenjdk.net/) or your system packager.
+
+
Android development environment
+
+Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
+
+
1. Install Android Studio
+
+[Download and install Android Studio](https://developer.android.com/studio/index.html). While on Android Studio installation wizard, make sure the boxes next to all of the following items are checked:
+
+- `Android SDK`
+- `Android SDK Platform`
+- `Android Virtual Device`
+
+Then, click "Next" to install all of these components.
+
+> If the checkboxes are grayed out, you will have a chance to install these components later on.
+
+Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
+
+
2. Install the Android SDK
+
+Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the `Android 12 (S)` SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.
+
+To do that, open Android Studio, click on "Configure" button and select "SDK Manager".
+
+> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
+
+Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 12 (S)` entry, then make sure the following items are checked:
+
+- `Android SDK Platform 31`
+- `Intel x86 Atom_64 System Image` or `Google APIs Intel x86 Atom System Image`
+
+Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build-Tools" entry, then make sure that `31.0.0` is selected.
+
+Finally, click "Apply" to download and install the Android SDK and related build tools.
+
+
3. Configure the ANDROID_SDK_ROOT environment variable
+
+The React Native tools require some environment variables to be set up in order to build apps with native code.
+
+Add the following lines to your `$HOME/.bash_profile` or `$HOME/.bashrc` (if you are using `zsh` then `~/.zprofile` or `~/.zshrc`) config file:
+
+```shell
+export ANDROID_SDK_ROOT=$HOME/Library/Android/Sdk
+export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
+export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
+```
+
+> `.bash_profile` is specific to `bash`. If you're using another shell, you will need to edit the appropriate shell-specific config file.
+
+Type `source $HOME/.bash_profile` for `bash` or `source $HOME/.zprofile` to load the config into your current shell. Verify that ANDROID_SDK_ROOT has been set by running `echo $ANDROID_SDK_ROOT` and the appropriate directories have been added to your path by running `echo $PATH`.
+
+> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
+
+
Watchman
+
+Follow the [Watchman installation guide](https://facebook.github.io/watchman/docs/install/#buildinstall) to compile and install Watchman from source.
+
+> [Watchman](https://facebook.github.io/watchman/docs/install/) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance and increased compatibility in certain edge cases (translation: you may be able to get by without installing this, but your mileage may vary; installing this now may save you from a headache later).
+
+
React Native Command Line Interface
+
+React Native has a built-in command line interface. Rather than install and manage a specific version of the CLI globally, we recommend you access the current version at runtime using `npx`, which ships with Node.js. With `npx react-native `, the current stable version of the CLI will be downloaded and executed at the time the command is run.
+
+
Creating a new application
+
+
+
+React Native has a built-in command line interface, which you can use to generate a new project. You can access it without installing anything globally using `npx`, which ships with Node.js. Let's create a new React Native project called "AwesomeProject":
+
+```shell
+npx react-native init AwesomeProject
+```
+
+This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo, or if you're adding Android support to an existing React Native project (see [Integration with Existing Apps](integration-with-existing-apps.md)). You can also use a third-party CLI to init your React Native app, such as [Ignite CLI](https://github.com/infinitered/ignite).
+
+
[Optional] Using a specific version or template
+
+If you want to start a new project with a specific React Native version, you can use the `--version` argument:
+
+```shell
+npx react-native init AwesomeProject --version X.XX.X
+```
+
+You can also start a project with a custom React Native template, like TypeScript, with `--template` argument:
+
+```shell
+npx react-native init AwesomeTSProject --template react-native-template-typescript
+```
+
+
Preparing the Android device
+
+You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
+
+Either way, you will need to prepare the device to run Android apps for development.
+
+
Using a physical device
+
+If you have a physical Android device, you can use it for development in place of an AVD by plugging it in to your computer using a USB cable and following the instructions [here](running-on-device.md).
+
+
Using a virtual device
+
+If you use Android Studio to open `./AwesomeProject/android`, you can see the list of available Android Virtual Devices (AVDs) by opening the "AVD Manager" from within Android Studio. Look for an icon that looks like this:
+
+
+
+If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **S** API Level 31 image.
+
+> We recommend configuring [VM acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux) on your system to improve performance. Once you've followed those instructions, go back to the AVD Manager.
+
+Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it, then proceed to the next step.
+
+
Running your React Native application
+
+
Step 1: Start Metro
+
+First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
+
+To start Metro, run `npx react-native start` inside your React Native project folder:
+
+```shell
+npx react-native start
+```
+
+`react-native start` starts Metro Bundler.
+
+> If you use the Yarn package manager, you can use `yarn` instead of `npx` when running React Native commands inside an existing project.
+
+> If you're familiar with web development, Metro is a lot like webpack—for React Native apps. Unlike Kotlin or Java, JavaScript isn't compiled—and neither is React Native. Bundling isn't the same as compiling, but it can help improve startup performance and translate some platform-specific JavaScript into more widely supported JavaScript.
+
+
Step 2: Start your application
+
+Let Metro Bundler run in its own terminal. Open a new terminal inside your React Native project folder. Run the following:
+
+```shell
+npx react-native run-android
+```
+
+If everything is set up correctly, you should see your new app running in your Android emulator shortly.
+
+`npx react-native run-android` is one way to run your app - you can also run it directly from within Android Studio.
+
+> If you can't get this to work, see the [Troubleshooting](troubleshooting.md) page.
+
+
Modifying your app
+
+Now that you have successfully run the app, let's modify it.
+
+- Open `App.js` in your text editor of choice and edit some lines.
+- Press the `R` key twice or select `Reload` from the Developer Menu (`Ctrl + M`) to see your changes!
+
+
That's it!
+
+Congratulations! You've successfully run and modified your first React Native app.
+
+
+
+
Now what?
+
+- If you want to add this new React Native code to an existing application, check out the [Integration guide](integration-with-existing-apps.md).
+
+If you're curious to learn more about React Native, check out the [Introduction to React Native](getting-started).
diff --git a/website/versioned_docs/version-0.70/_getting-started-macos-android.md b/website/versioned_docs/version-0.70/_getting-started-macos-android.md
new file mode 100644
index 00000000000..fd52291bab0
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_getting-started-macos-android.md
@@ -0,0 +1,191 @@
+import RemoveGlobalCLI from './\_remove-global-cli.md';
+
+## Installing dependencies
+
+You will need Node, Watchman, the React Native command line interface, a JDK, and Android Studio.
+
+While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.
+
+
Node & Watchman
+
+We recommend installing Node and Watchman using [Homebrew](http://brew.sh/). Run the following commands in a Terminal after installing Homebrew:
+
+```shell
+brew install node
+brew install watchman
+```
+
+If you have already installed Node on your system, make sure it is Node 14 or newer.
+
+[Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
+
+
Java Development Kit
+
+We recommend installing the OpenJDK distribution called Azul **Zulu** using [Homebrew](http://brew.sh/). Run the following commands in a Terminal after installing Homebrew:
+
+```shell
+brew tap homebrew/cask-versions
+brew install --cask zulu11
+```
+
+The Zulu OpenJDK distribution offers JDKs for **both Intel and M1 Macs**. This will make sure your builds are faster on M1 Macs compared to using an Intel-based JDK.
+
+If you have already installed JDK on your system, we recommend JDK 11. You may encounter problems using higher JDK versions.
+
+
Android development environment
+
+Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
+
+
1. Install Android Studio
+
+[Download and install Android Studio](https://developer.android.com/studio/index.html). While on Android Studio installation wizard, make sure the boxes next to all of the following items are checked:
+
+- `Android SDK`
+- `Android SDK Platform`
+- `Android Virtual Device`
+
+Then, click "Next" to install all of these components.
+
+> If the checkboxes are grayed out, you will have a chance to install these components later on.
+
+Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
+
+
2. Install the Android SDK
+
+Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the `Android 12 (S)` SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.
+
+To do that, open Android Studio, click on "More Actions" button and select "SDK Manager".
+
+
+
+> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
+
+Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 12 (S)` entry, then make sure the following items are checked:
+
+- `Android SDK Platform 31`
+- `Intel x86 Atom_64 System Image` or `Google APIs Intel x86 Atom System Image` or (for Apple M1 Silicon) `Google APIs ARM 64 v8a System Image`
+
+Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the "Android SDK Build-Tools" entry, then make sure that `31.0.0` is selected.
+
+Finally, click "Apply" to download and install the Android SDK and related build tools.
+
+
3. Configure the ANDROID_SDK_ROOT environment variable
+
+The React Native tools require some environment variables to be set up in order to build apps with native code.
+
+Add the following lines to your `$HOME/.bash_profile` or `$HOME/.bashrc` (if you are using `zsh` then `~/.zprofile` or `~/.zshrc`) config file:
+
+```shell
+export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk
+export PATH=$PATH:$ANDROID_SDK_ROOT/emulator
+export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
+```
+
+> `.bash_profile` is specific to `bash`. If you're using another shell, you will need to edit the appropriate shell-specific config file.
+
+Type `source $HOME/.bash_profile` for `bash` or `source $HOME/.zprofile` to load the config into your current shell. Verify that ANDROID_SDK_ROOT has been set by running `echo $ANDROID_SDK_ROOT` and the appropriate directories have been added to your path by running `echo $PATH`.
+
+> Please make sure you use the correct Android SDK path. You can find the actual location of the SDK in the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
+
+
React Native Command Line Interface
+
+React Native has a built-in command line interface. Rather than install and manage a specific version of the CLI globally, we recommend you access the current version at runtime using `npx`, which ships with Node.js. With `npx react-native `, the current stable version of the CLI will be downloaded and executed at the time the command is run.
+
+
Creating a new application
+
+
+
+React Native has a built-in command line interface, which you can use to generate a new project. You can access it without installing anything globally using `npx`, which ships with Node.js. Let's create a new React Native project called "AwesomeProject":
+
+```shell
+npx react-native init AwesomeProject
+```
+
+This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo, or if you're adding Android support to an existing React Native project (see [Integration with Existing Apps](integration-with-existing-apps.md)). You can also use a third-party CLI to init your React Native app, such as [Ignite CLI](https://github.com/infinitered/ignite).
+
+
[Optional] Using a specific version or template
+
+If you want to start a new project with a specific React Native version, you can use the `--version` argument:
+
+```shell
+npx react-native init AwesomeProject --version X.XX.X
+```
+
+You can also start a project with a custom React Native template, like TypeScript, with `--template` argument:
+
+```shell
+npx react-native init AwesomeTSProject --template react-native-template-typescript
+```
+
+
Preparing the Android device
+
+You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
+
+Either way, you will need to prepare the device to run Android apps for development.
+
+
Using a physical device
+
+If you have a physical Android device, you can use it for development in place of an AVD by plugging it in to your computer using a USB cable and following the instructions [here](running-on-device.md).
+
+
Using a virtual device
+
+If you use Android Studio to open `./AwesomeProject/android`, you can see the list of available Android Virtual Devices (AVDs) by opening the "AVD Manager" from within Android Studio. Look for an icon that looks like this:
+
+
+
+If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **S** API Level 31 image.
+
+Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it, then proceed to the next step.
+
+
Running your React Native application
+
+
Step 1: Start Metro
+
+First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
+
+To start Metro, run `npx react-native start` inside your React Native project folder:
+
+```shell
+npx react-native start
+```
+
+`react-native start` starts Metro Bundler.
+
+> If you use the Yarn package manager, you can use `yarn` instead of `npx` when running React Native commands inside an existing project.
+
+> If you're familiar with web development, Metro is a lot like webpack—for React Native apps. Unlike Kotlin or Java, JavaScript isn't compiled—and neither is React Native. Bundling isn't the same as compiling, but it can help improve startup performance and translate some platform-specific JavaScript into more widely supported JavaScript.
+
+
Step 2: Start your application
+
+Let Metro Bundler run in its own terminal. Open a new terminal inside your React Native project folder. Run the following:
+
+```shell
+npx react-native run-android
+```
+
+If everything is set up correctly, you should see your new app running in your Android emulator shortly.
+
+
+
+`npx react-native run-android` is one way to run your app - you can also run it directly from within Android Studio.
+
+> If you can't get this to work, see the [Troubleshooting](troubleshooting.md) page.
+
+
Modifying your app
+
+Now that you have successfully run the app, let's modify it.
+
+- Open `App.js` in your text editor of choice and edit some lines.
+- Press the `R` key twice or select `Reload` from the Developer Menu (`⌘M`) to see your changes!
+
+
That's it!
+
+Congratulations! You've successfully run and modified your first React Native app.
+
+
+
+
Now what?
+
+- If you want to add this new React Native code to an existing application, check out the [Integration guide](integration-with-existing-apps.md).
+
+If you're curious to learn more about React Native, check out the [Introduction to React Native](getting-started).
diff --git a/website/versioned_docs/version-0.70/_getting-started-macos-ios.md b/website/versioned_docs/version-0.70/_getting-started-macos-ios.md
new file mode 100644
index 00000000000..9860a4cc4ba
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_getting-started-macos-ios.md
@@ -0,0 +1,150 @@
+import M1Cocoapods from './\_markdown-m1-cocoapods.mdx'; import RemoveGlobalCLI from './\_remove-global-cli.md';
+
+## Installing dependencies
+
+You will need Node, Watchman, the React Native command line interface, Xcode and CocoaPods.
+
+While you can use any editor of your choice to develop your app, you will need to install Xcode in order to set up the necessary tooling to build your React Native app for iOS.
+
+### Node & Watchman
+
+We recommend installing Node and Watchman using [Homebrew](http://brew.sh/). Run the following commands in a Terminal after installing Homebrew:
+
+```shell
+brew install node
+brew install watchman
+```
+
+If you have already installed Node on your system, make sure it is Node 14 or newer.
+
+[Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
+
+### Xcode
+
+The easiest way to install Xcode is via the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12). Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
+
+If you have already installed Xcode on your system, make sure it is version 10 or newer.
+
+#### Command Line Tools
+
+You will also need to install the Xcode Command Line Tools. Open Xcode, then choose "Preferences..." from the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
+
+
+
+#### Installing an iOS Simulator in Xcode
+
+To install a simulator, open Xcode > Preferences... and select the Components tab. Select a simulator with the corresponding version of iOS you wish to use.
+
+#### CocoaPods
+
+[CocoaPods](https://cocoapods.org/) is built with Ruby and it will be installable with the default Ruby available on macOS.
+
+Using the default Ruby available on macOS will require you to use `sudo` when installing gems. (This is only an issue for the duration of the gem installation, though.)
+
+```shell
+sudo gem install cocoapods
+```
+
+Otherwise you can use a Ruby version manager, such as `rbenv`. Apps created with the command `npx react-native init` described below are configured to work well with `rbenv` and will pick the correct Ruby version requested by the template.
+
+For more information, please visit [CocoaPods Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
+
+
+
+### React Native Command Line Interface
+
+React Native has a built-in command line interface. Rather than install and manage a specific version of the CLI globally, we recommend you access the current version at runtime using `npx`, which ships with Node.js. With `npx react-native `, the current stable version of the CLI will be downloaded and executed at the time the command is run.
+
+## Creating a new application
+
+
+
+You can use React Native's built-in command line interface to generate a new project. Let's create a new React Native project called "AwesomeProject":
+
+```shell
+npx react-native init AwesomeProject
+```
+
+This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo, or if you're adding iOS support to an existing React Native project (see [Integration with Existing Apps](integration-with-existing-apps.md)). You can also use a third-party CLI to init your React Native app, such as [Ignite CLI](https://github.com/infinitered/ignite).
+
+### [Optional] Using a specific version or template
+
+If you want to start a new project with a specific React Native version, you can use the `--version` argument:
+
+```shell
+npx react-native init AwesomeProject --version X.XX.X
+```
+
+You can also start a project with a custom React Native template, like TypeScript, with `--template` argument:
+
+```shell
+npx react-native init AwesomeTSProject --template react-native-template-typescript
+```
+
+> **Note** If the above command is failing, you may have old version of `react-native` or `react-native-cli` installed globally on your pc. Try uninstalling the cli and run the cli using `npx`.
+
+### [Optional] Configuring your environment
+
+Starting from React Native version 0.69, it is possible to configure the Xcode environment using the `.xcode.env` file provided by the template.
+
+The `.xcode.env` file contains an environment variable to export the path to the `node` executable in the `NODE_BINARY` variable.
+This is the **suggested approach** to decouple the build infrastructure from the system version of `node`. You should customize this variable with your own path or your own `node` version manager, if it differs from the default.
+
+On top of this, it's possible to add any other environment variable and to source the `.xcode.env` file in your build script phases. If you need to run script that requires some specific environment, this is the **suggested approach**: it allows to decouple the build phases from a specific environment.
+
+## Running your React Native application
+
+### Step 1: Start Metro
+
+First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
+
+To start Metro, run `npx react-native start` inside your React Native project folder:
+
+```shell
+npx react-native start
+```
+
+`react-native start` starts Metro Bundler.
+
+> If you use the Yarn package manager, you can use `yarn` instead of `npx` when running React Native commands inside an existing project.
+
+> If you're familiar with web development, Metro is a lot like webpack—for React Native apps. Unlike Swift or Objective-C, JavaScript isn't compiled—and neither is React Native. Bundling isn't the same as compiling, but it can help improve startup performance and translate some platform-specific JavaScript into more widely supported JavaScript.
+
+### Step 2: Start your application
+
+Let Metro Bundler run in its own terminal. Open a new terminal inside your React Native project folder. Run the following:
+
+```shell
+npx react-native run-ios
+```
+
+You should see your new app running in the iOS Simulator shortly.
+
+
+
+`npx react-native run-ios` is one way to run your app. You can also run it directly from within Xcode.
+
+> If you can't get this to work, see the [Troubleshooting](troubleshooting.md) page.
+
+### Running on a device
+
+The above command will automatically run your app on the iOS Simulator by default. If you want to run the app on an actual physical iOS device, please follow the instructions [here](running-on-device.md).
+
+### Modifying your app
+
+Now that you have successfully run the app, let's modify it.
+
+- Open `App.js` in your text editor of choice and edit some lines.
+- Hit `⌘R` in your iOS Simulator to reload the app and see your changes!
+
+### That's it!
+
+Congratulations! You've successfully run and modified your first React Native app.
+
+
+
+## Now what?
+
+- If you want to add this new React Native code to an existing application, check out the [Integration guide](integration-with-existing-apps.md).
+
+If you're curious to learn more about React Native, check out the [Introduction to React Native](getting-started).
diff --git a/website/versioned_docs/version-0.70/_getting-started-windows-android.md b/website/versioned_docs/version-0.70/_getting-started-windows-android.md
new file mode 100644
index 00000000000..038a898e240
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_getting-started-windows-android.md
@@ -0,0 +1,210 @@
+import RemoveGlobalCLI from './\_remove-global-cli.md';
+
+
Installing dependencies
+
+You will need Node, the React Native command line interface, a JDK, and Android Studio.
+
+While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.
+
+
Node, JDK
+
+We recommend installing Node via [Chocolatey](https://chocolatey.org), a popular package manager for Windows.
+
+It is recommended to use an LTS version of Node. If you want to be able to switch between different versions, you might want to install Node via [nvm-windows](https://github.com/coreybutler/nvm-windows), a Node version manager for Windows.
+
+React Native also requires [Java SE Development Kit (JDK)](https://openjdk.java.net/projects/jdk/11/), which can be installed using Chocolatey as well.
+
+Open an Administrator Command Prompt (right click Command Prompt and select "Run as Administrator"), then run the following command:
+
+```powershell
+choco install -y nodejs-lts openjdk11
+```
+
+If you have already installed Node on your system, make sure it is Node 14 or newer. If you already have a JDK on your system, we recommend JDK11. You may encounter problems using higher JDK versions.
+
+> You can find additional installation options on [Node's Downloads page](https://nodejs.org/en/download/).
+
+> If you're using the latest version of Java Development Kit, you'll need to change the Gradle version of your project so it can recognize the JDK. You can do that by going to `{project root folder}\android\gradle\wrapper\gradle-wrapper.properties` and changing the `distributionUrl` value to upgrade the Gradle version. You can check out [here the lastest releases of Gradle](https://gradle.org/releases/).
+
+
Android development environment
+
+Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
+
+
1. Install Android Studio
+
+[Download and install Android Studio](https://developer.android.com/studio/index.html). While on Android Studio installation wizard, make sure the boxes next to all of the following items are checked:
+
+- `Android SDK`
+- `Android SDK Platform`
+- `Android Virtual Device`
+- If you are not already using Hyper-V: `Performance (Intel ® HAXM)` ([See here for AMD or Hyper-V](https://android-developers.googleblog.com/2018/07/android-emulator-amd-processor-hyper-v.html))
+
+Then, click "Next" to install all of these components.
+
+> If the checkboxes are grayed out, you will have a chance to install these components later on.
+
+Once setup has finalized and you're presented with the Welcome screen, proceed to the next step.
+
+
2. Install the Android SDK
+
+Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the `Android 12 (S)` SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.
+
+To do that, open Android Studio, click on "More Actions" button and select "SDK Manager".
+
+
+
+> The SDK Manager can also be found within the Android Studio "Preferences" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
+
+Select the "SDK Platforms" tab from within the SDK Manager, then check the box next to "Show Package Details" in the bottom right corner. Look for and expand the `Android 12 (S)` entry, then make sure the following items are checked:
+
+- `Android SDK Platform 31`
+- `Intel x86 Atom_64 System Image` or `Google APIs Intel x86 Atom System Image`
+
+Next, select the "SDK Tools" tab and check the box next to "Show Package Details" here as well. Look for and expand the `Android SDK Build-Tools` entry, then make sure that `31.0.0` is selected.
+
+Finally, click "Apply" to download and install the Android SDK and related build tools.
+
+
3. Configure the ANDROID_HOME environment variable
+
+The React Native tools require some environment variables to be set up in order to build apps with native code.
+
+1. Open the **Windows Control Panel.**
+2. Click on **User Accounts,** then click **User Accounts** again
+3. Click on **Change my environment variables**
+4. Click on **New...** to create a new `ANDROID_HOME` user variable that points to the path to your Android SDK:
+
+
+
+The SDK is installed, by default, at the following location:
+
+```powershell
+%LOCALAPPDATA%\Android\Sdk
+```
+
+You can find the actual location of the SDK in the Android Studio "Settings" dialog, under **Appearance & Behavior** → **System Settings** → **Android SDK**.
+
+Open a new Command Prompt window to ensure the new environment variable is loaded before proceeding to the next step.
+
+1. Open powershell
+2. Copy and paste **Get-ChildItem -Path Env:\\** into powershell
+3. Verify `ANDROID_HOME` has been added
+
+
4. Add platform-tools to Path
+
+1. Open the **Windows Control Panel.**
+2. Click on **User Accounts,** then click **User Accounts** again
+3. Click on **Change my environment variables**
+4. Select the **Path** variable.
+5. Click **Edit.**
+6. Click **New** and add the path to platform-tools to the list.
+
+The default location for this folder is:
+
+```powershell
+%LOCALAPPDATA%\Android\Sdk\platform-tools
+```
+
+
React Native Command Line Interface
+
+React Native has a built-in command line interface. Rather than install and manage a specific version of the CLI globally, we recommend you access the current version at runtime using `npx`, which ships with Node.js. With `npx react-native `, the current stable version of the CLI will be downloaded and executed at the time the command is run.
+
+
Creating a new application
+
+
+
+React Native has a built-in command line interface, which you can use to generate a new project. You can access it without installing anything globally using `npx`, which ships with Node.js. Let's create a new React Native project called "AwesomeProject":
+
+```shell
+npx react-native init AwesomeProject
+```
+
+This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo, or if you're adding Android support to an existing React Native project (see [Integration with Existing Apps](integration-with-existing-apps.md)). You can also use a third-party CLI to init your React Native app, such as [Ignite CLI](https://github.com/infinitered/ignite).
+
+
[Optional] Using a specific version or template
+
+If you want to start a new project with a specific React Native version, you can use the `--version` argument:
+
+```shell
+npx react-native init AwesomeProject --version X.XX.X
+```
+
+You can also start a project with a custom React Native template, like TypeScript, with `--template` argument:
+
+```shell
+npx react-native init AwesomeTSProject --template react-native-template-typescript
+```
+
+
Preparing the Android device
+
+You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
+
+Either way, you will need to prepare the device to run Android apps for development.
+
+
Using a physical device
+
+If you have a physical Android device, you can use it for development in place of an AVD by plugging it in to your computer using a USB cable and following the instructions [here](running-on-device.md).
+
+
Using a virtual device
+
+If you use Android Studio to open `./AwesomeProject/android`, you can see the list of available Android Virtual Devices (AVDs) by opening the "AVD Manager" from within Android Studio. Look for an icon that looks like this:
+
+
+
+If you have recently installed Android Studio, you will likely need to [create a new AVD](https://developer.android.com/studio/run/managing-avds.html). Select "Create Virtual Device...", then pick any Phone from the list and click "Next", then select the **S** API Level 31 image.
+
+> If you don't have HAXM installed, click on "Install HAXM" or follow [these instructions](https://github.com/intel/haxm/wiki/Installation-Instructions-on-Windows) to set it up, then go back to the AVD Manager.
+
+Click "Next" then "Finish" to create your AVD. At this point you should be able to click on the green triangle button next to your AVD to launch it, then proceed to the next step.
+
+
Running your React Native application
+
+
Step 1: Start Metro
+
+First, you will need to start Metro, the JavaScript bundler that ships with React Native. Metro "takes in an entry file and various options, and returns a single JavaScript file that includes all your code and its dependencies."—[Metro Docs](https://facebook.github.io/metro/docs/concepts)
+
+To start Metro, run `npx react-native start` inside your React Native project folder:
+
+```shell
+npx react-native start
+```
+
+`react-native start` starts Metro Bundler.
+
+> If you use the Yarn package manager, you can use `yarn` instead of `npx` when running React Native commands inside an existing project.
+
+> If you're familiar with web development, Metro is a lot like webpack—for React Native apps. Unlike Kotlin or Java, JavaScript isn't compiled—and neither is React Native. Bundling isn't the same as compiling, but it can help improve startup performance and translate some platform-specific JavaScript into more widely supported JavaScript.
+
+
Step 2: Start your application
+
+Let Metro Bundler run in its own terminal. Open a new terminal inside your React Native project folder. Run the following:
+
+```shell
+npx react-native run-android
+```
+
+If everything is set up correctly, you should see your new app running in your Android emulator shortly.
+
+
+
+`npx react-native run-android` is one way to run your app - you can also run it directly from within Android Studio.
+
+> If you can't get this to work, see the [Troubleshooting](troubleshooting.md) page.
+
+
Modifying your app
+
+Now that you have successfully run the app, let's modify it.
+
+- Open `App.js` in your text editor of choice and edit some lines.
+- Press the `R` key twice or select `Reload` from the Developer Menu (`Ctrl + M`) to see your changes!
+
+
That's it!
+
+Congratulations! You've successfully run and modified your first React Native app.
+
+
+
+
Now what?
+
+- If you want to add this new React Native code to an existing application, check out the [Integration guide](integration-with-existing-apps.md).
+
+If you're curious to learn more about React Native, check out the [Introduction to React Native](getting-started).
diff --git a/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-java.md b/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-java.md
new file mode 100644
index 00000000000..f090f7083be
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-java.md
@@ -0,0 +1,388 @@
+## Key Concepts
+
+The keys to integrating React Native components into your Android application are to:
+
+1. Set up React Native dependencies and directory structure.
+2. Develop your React Native components in JavaScript.
+3. Add a `ReactRootView` to your Android app. This view will serve as the container for your React Native component.
+4. Start the React Native server and run your native application.
+5. Verify that the React Native aspect of your application works as expected.
+
+## Prerequisites
+
+Follow the React Native CLI Quickstart in the [environment setup guide](environment-setup) to configure your development environment for building React Native apps for Android.
+
+### 1. Set up directory structure
+
+To ensure a smooth experience, create a new folder for your integrated React Native project, then copy your existing Android project to an `/android` subfolder.
+
+### 2. Install JavaScript dependencies
+
+Go to the root directory for your project and create a new `package.json` file with the following contents:
+
+```
+{
+ "name": "MyReactNativeApp",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "start": "yarn react-native start"
+ }
+}
+```
+
+Next, make sure you have [installed the yarn package manager](https://yarnpkg.com/lang/en/docs/install/).
+
+Install the `react` and `react-native` packages. Open a terminal or command prompt, then navigate to the directory with your `package.json` file and run:
+
+```shell
+$ yarn add react-native
+```
+
+This will print a message similar to the following (scroll up in the yarn output to see it):
+
+> warning "react-native@0.52.2" has unmet peer dependency "react@16.2.0".
+
+This is OK, it means we also need to install React:
+
+```shell
+$ yarn add react@version_printed_above
+```
+
+Yarn has created a new `/node_modules` folder. This folder stores all the JavaScript dependencies required to build your project.
+
+Add `node_modules/` to your `.gitignore` file.
+
+## Adding React Native to your app
+
+### Configuring maven
+
+Add the React Native and JSC dependency to your app's `build.gradle` file:
+
+```gradle
+dependencies {
+ implementation "com.android.support:appcompat-v7:27.1.1"
+ ...
+ implementation "com.facebook.react:react-native:+" // From node_modules
+ implementation "org.webkit:android-jsc:+"
+}
+```
+
+> If you want to ensure that you are always using a specific React Native version in your native build, replace `+` with an actual React Native version you've downloaded from `npm`.
+
+Add an entry for the local React Native and JSC maven directories to the top-level `build.gradle`. Be sure to add it to the “allprojects” block, above other maven repositories:
+
+```gradle
+allprojects {
+ repositories {
+ maven {
+ // All of React Native (JS, Android binaries) is installed from npm
+ url "$rootDir/../node_modules/react-native/android"
+ }
+ maven {
+ // Android JSC is installed from npm
+ url("$rootDir/../node_modules/jsc-android/dist")
+ }
+ ...
+ }
+ ...
+}
+```
+
+> Make sure that the path is correct! You shouldn’t run into any “Failed to resolve: com.facebook.react:react-native:0.x.x" errors after running Gradle sync in Android Studio.
+
+### Enable native modules autolinking
+
+To use the power of [autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md), we have to apply it a few places. First add the following entry to `settings.gradle`:
+
+```gradle
+apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
+```
+
+Next add the following entry at the very bottom of the `app/build.gradle`:
+
+```gradle
+apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
+```
+
+### Configuring permissions
+
+Next, make sure you have the Internet permission in your `AndroidManifest.xml`:
+
+
+
+If you need to access to the `DevSettingsActivity` add to your `AndroidManifest.xml`:
+
+
+
+This is only used in dev mode when reloading JavaScript from the development server, so you can strip this in release builds if you need to.
+
+### Cleartext Traffic (API level 28+)
+
+> Starting with Android 9 (API level 28), cleartext traffic is disabled by default; this prevents your application from connecting to the [Metro bundler][metro]. The changes below allow cleartext traffic in debug builds.
+
+#### 1. Apply the `usesCleartextTraffic` option to your Debug `AndroidManifest.xml`
+
+```xml
+
+
+
+
+
+```
+
+This is not required for Release builds.
+
+To learn more about Network Security Config and the cleartext traffic policy [see this link](https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted).
+
+### Code integration
+
+Now we will actually modify the native Android application to integrate React Native.
+
+#### The React Native component
+
+The first bit of code we will write is the actual React Native code for the new "High Score" screen that will be integrated into our application.
+
+##### 1. Create a `index.js` file
+
+First, create an empty `index.js` file in the root of your React Native project.
+
+`index.js` is the starting point for React Native applications, and it is always required. It can be a small file that `require`s other file that are part of your React Native component or application, or it can contain all the code that is needed for it. In our case, we will put everything in `index.js`.
+
+##### 2. Add your React Native code
+
+In your `index.js`, create your component. In our sample here, we will add a `` component within a styled ``:
+
+```jsx
+import React from 'react';
+import {
+ AppRegistry,
+ StyleSheet,
+ Text,
+ View
+} from 'react-native';
+
+const HelloWorld = () => {
+ return (
+
+ Hello, World
+
+ );
+};
+var styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center'
+ },
+ hello: {
+ fontSize: 20,
+ textAlign: 'center',
+ margin: 10
+ }
+});
+
+AppRegistry.registerComponent(
+ 'MyReactNativeApp',
+ () => HelloWorld
+);
+```
+
+##### 3. Configure permissions for development error overlay
+
+If your app is targeting the Android `API level 23` or greater, make sure you have the permission `android.permission.SYSTEM_ALERT_WINDOW` enabled for the development build. You can check this with `Settings.canDrawOverlays(this);`. This is required in dev builds because React Native development errors must be displayed above all the other windows. Due to the new permissions system introduced in the API level 23 (Android M), the user needs to approve it. This can be achieved by adding the following code to your Activity's in `onCreate()` method.
+
+```java
+private final int OVERLAY_PERMISSION_REQ_CODE = 1; // Choose any value
+
+...
+
+if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ if (!Settings.canDrawOverlays(this)) {
+ Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
+ Uri.parse("package:" + getPackageName()));
+ startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
+ }
+}
+```
+
+Finally, the `onActivityResult()` method (as shown in the code below) has to be overridden to handle the permission Accepted or Denied cases for consistent UX. Also, for integrating Native Modules which use `startActivityForResult`, we need to pass the result to the `onActivityResult` method of our `ReactInstanceManager` instance.
+
+```java
+@Override
+protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (requestCode == OVERLAY_PERMISSION_REQ_CODE) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ if (!Settings.canDrawOverlays(this)) {
+ // SYSTEM_ALERT_WINDOW permission not granted
+ }
+ }
+ }
+ mReactInstanceManager.onActivityResult( this, requestCode, resultCode, data );
+}
+```
+
+#### The Magic: `ReactRootView`
+
+Let's add some native code in order to start the React Native runtime and tell it to render our JS component. To do this, we're going to create an `Activity` that creates a `ReactRootView`, starts a React application inside it and sets it as the main content view.
+
+> If you are targeting Android version <5, use the `AppCompatActivity` class from the `com.android.support:appcompat` package instead of `Activity`.
+
+```java
+public class MyReactActivity extends Activity implements DefaultHardwareBackBtnHandler {
+ private ReactRootView mReactRootView;
+ private ReactInstanceManager mReactInstanceManager;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ SoLoader.init(this, false);
+
+ mReactRootView = new ReactRootView(this);
+ List packages = new PackageList(getApplication()).getPackages();
+ // Packages that cannot be autolinked yet can be added manually here, for example:
+ // packages.add(new MyReactNativePackage());
+ // Remember to include them in `settings.gradle` and `app/build.gradle` too.
+
+ mReactInstanceManager = ReactInstanceManager.builder()
+ .setApplication(getApplication())
+ .setCurrentActivity(this)
+ .setBundleAssetName("index.android.bundle")
+ .setJSMainModulePath("index")
+ .addPackages(packages)
+ .setUseDeveloperSupport(BuildConfig.DEBUG)
+ .setInitialLifecycleState(LifecycleState.RESUMED)
+ .build();
+ // The string here (e.g. "MyReactNativeApp") has to match
+ // the string in AppRegistry.registerComponent() in index.js
+ mReactRootView.startReactApplication(mReactInstanceManager, "MyReactNativeApp", null);
+
+ setContentView(mReactRootView);
+ }
+
+ @Override
+ public void invokeDefaultOnBackPressed() {
+ super.onBackPressed();
+ }
+}
+```
+
+> If you are using a starter kit for React Native, replace the "HelloWorld" string with the one in your index.js file (it’s the first argument to the `AppRegistry.registerComponent()` method).
+
+Perform a “Sync Project files with Gradle” operation.
+
+If you are using Android Studio, use `Alt + Enter` to add all missing imports in your MyReactActivity class. Be careful to use your package’s `BuildConfig` and not the one from the `facebook` package.
+
+We need set the theme of `MyReactActivity` to `Theme.AppCompat.Light.NoActionBar` because some React Native UI components rely on this theme.
+
+```xml
+
+
+```
+
+> A `ReactInstanceManager` can be shared by multiple activities and/or fragments. You will want to make your own `ReactFragment` or `ReactActivity` and have a singleton _holder_ that holds a `ReactInstanceManager`. When you need the `ReactInstanceManager` (e.g., to hook up the `ReactInstanceManager` to the lifecycle of those Activities or Fragments) use the one provided by the singleton.
+
+Next, we need to pass some activity lifecycle callbacks to the `ReactInstanceManager` and `ReactRootView`:
+
+```java
+@Override
+protected void onPause() {
+ super.onPause();
+
+ if (mReactInstanceManager != null) {
+ mReactInstanceManager.onHostPause(this);
+ }
+}
+
+@Override
+protected void onResume() {
+ super.onResume();
+
+ if (mReactInstanceManager != null) {
+ mReactInstanceManager.onHostResume(this, this);
+ }
+}
+
+@Override
+protected void onDestroy() {
+ super.onDestroy();
+
+ if (mReactInstanceManager != null) {
+ mReactInstanceManager.onHostDestroy(this);
+ }
+ if (mReactRootView != null) {
+ mReactRootView.unmountReactApplication();
+ }
+}
+```
+
+We also need to pass back button events to React Native:
+
+```java
+@Override
+ public void onBackPressed() {
+ if (mReactInstanceManager != null) {
+ mReactInstanceManager.onBackPressed();
+ } else {
+ super.onBackPressed();
+ }
+}
+```
+
+This allows JavaScript to control what happens when the user presses the hardware back button (e.g. to implement navigation). When JavaScript doesn't handle the back button press, your `invokeDefaultOnBackPressed` method will be called. By default this finishes your `Activity`.
+
+Finally, we need to hook up the dev menu. By default, this is activated by (rage) shaking the device, but this is not very useful in emulators. So we make it show when you press the hardware menu button (use `Ctrl + M` if you're using Android Studio emulator):
+
+```java
+@Override
+public boolean onKeyUp(int keyCode, KeyEvent event) {
+ if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) {
+ mReactInstanceManager.showDevOptionsDialog();
+ return true;
+ }
+ return super.onKeyUp(keyCode, event);
+}
+```
+
+Now your activity is ready to run some JavaScript code.
+
+### Test your integration
+
+You have now done all the basic steps to integrate React Native with your current application. Now we will start the [Metro bundler][metro] to build the `index.bundle` package and the server running on localhost to serve it.
+
+##### 1. Run the packager
+
+To run your app, you need to first start the development server. To do this, run the following command in the root directory of your React Native project:
+
+```shell
+$ yarn start
+```
+
+##### 2. Run the app
+
+Now build and run your Android app as normal.
+
+Once you reach your React-powered activity inside the app, it should load the JavaScript code from the development server and display:
+
+
+
+### Creating a release build in Android Studio
+
+You can use Android Studio to create your release builds too! It’s as quick as creating release builds of your previously-existing native Android app. There’s one additional step, which you’ll have to do before every release build. You need to execute the following to create a React Native bundle, which will be included with your native Android app:
+
+```shell
+$ npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/com/your-company-name/app-package-name/src/main/assets/index.android.bundle --assets-dest android/com/your-company-name/app-package-name/src/main/res/
+```
+
+> Don’t forget to replace the paths with correct ones and create the assets folder if it doesn’t exist.
+
+Now, create a release build of your native app from within Android Studio as usual and you should be good to go!
+
+### Now what?
+
+At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.
+
+[metro]: https://facebook.github.io/metro/
diff --git a/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-objc.md b/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-objc.md
new file mode 100644
index 00000000000..893187c9b91
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-objc.md
@@ -0,0 +1,398 @@
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; import M1Cocoapods from './\_markdown-m1-cocoapods.mdx';
+
+## Key Concepts
+
+The keys to integrating React Native components into your iOS application are to:
+
+1. Set up React Native dependencies and directory structure.
+2. Understand what React Native components you will use in your app.
+3. Add these components as dependencies using CocoaPods.
+4. Develop your React Native components in JavaScript.
+5. Add a `RCTRootView` to your iOS app. This view will serve as the container for your React Native component.
+6. Start the React Native server and run your native application.
+7. Verify that the React Native aspect of your application works as expected.
+
+## Prerequisites
+
+Follow the React Native CLI Quickstart in the [environment setup guide](environment-setup) to configure your development environment for building React Native apps for iOS.
+
+### 1. Set up directory structure
+
+To ensure a smooth experience, create a new folder for your integrated React Native project, then copy your existing iOS project to a `/ios` subfolder.
+
+### 2. Install JavaScript dependencies
+
+Go to the root directory for your project and create a new `package.json` file with the following contents:
+
+```
+{
+ "name": "MyReactNativeApp",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "start": "yarn react-native start"
+ }
+}
+```
+
+Next, make sure you have [installed the yarn package manager](https://yarnpkg.com/lang/en/docs/install/).
+
+Install the `react` and `react-native` packages. Open a terminal or command prompt, then navigate to the directory with your `package.json` file and run:
+
+
+
+
+```shell
+npm install react-native
+```
+
+
+
+
+```shell
+yarn add react-native
+```
+
+
+
+
+This will print a message similar to the following (scroll up in the yarn output to see it):
+
+> warning "react-native@0.52.2" has unmet peer dependency "react@16.2.0".
+
+This is OK, it means we also need to install React:
+
+
+
+
+```shell
+npm install react@version_printed_above
+```
+
+
+
+
+```shell
+yarn add react@version_printed_above
+```
+
+
+
+
+Installation process has created a new `/node_modules` folder. This folder stores all the JavaScript dependencies required to build your project.
+
+Add `node_modules/` to your `.gitignore` file.
+
+### 3. Install CocoaPods
+
+[CocoaPods](http://cocoapods.org) is a package management tool for iOS and macOS development. We use it to add the actual React Native framework code locally into your current project.
+
+We recommend installing CocoaPods using [Homebrew](http://brew.sh/).
+
+```shell
+brew install cocoapods
+```
+
+> It is technically possible not to use CocoaPods, but that would require manual library and linker additions that would overly complicate this process.
+
+## Adding React Native to your app
+
+Assume the [app for integration](https://github.com/JoelMarcey/iOS-2048) is a [2048](https://en.wikipedia.org/wiki/2048_%28video_game%29) game. Here is what the main menu of the native application looks like without React Native.
+
+
+
+### Command Line Tools for Xcode
+
+Install the Command Line Tools. Choose "Preferences..." in the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
+
+
+
+### Configuring CocoaPods dependencies
+
+Before you integrate React Native into your application, you will want to decide what parts of the React Native framework you would like to integrate. We will use CocoaPods to specify which of these "subspecs" your app will depend on.
+
+The list of supported `subspec`s is available in [`/node_modules/react-native/React.podspec`](https://github.com/facebook/react-native/blob/master/React.podspec). They are generally named by functionality. For example, you will generally always want the `Core` `subspec`. That will get you the `AppRegistry`, `StyleSheet`, `View` and other core React Native libraries. If you want to add the React Native `Text` library (e.g., for `` elements), then you will need the `RCTText` `subspec`. If you want the `Image` library (e.g., for `` elements), then you will need the `RCTImage` `subspec`.
+
+You can specify which `subspec`s your app will depend on in a `Podfile` file. The easiest way to create a `Podfile` is by running the CocoaPods `init` command in the `/ios` subfolder of your project:
+
+```shell
+pod init
+```
+
+The `Podfile` will contain a boilerplate setup that you will tweak for your integration purposes.
+
+> The `Podfile` version changes depending on your version of `react-native`. Refer to https://react-native-community.github.io/upgrade-helper/ for the specific version of `Podfile` you should be using.
+
+Ultimately, your `Podfile` should look something similar to this:
+
+```
+# The target name is most likely the name of your project.
+target 'NumberTileGame' do
+
+ # Your 'node_modules' directory is probably in the root of your project,
+ # but if not, adjust the `:path` accordingly
+ pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
+ pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
+ pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
+ pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
+ pod 'React', :path => '../node_modules/react-native/'
+ pod 'React-Core', :path => '../node_modules/react-native/'
+ pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
+ pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
+ pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
+ pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
+ pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
+ pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
+ pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
+ pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
+ pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
+ pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
+ pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
+ pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
+
+ pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
+ pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
+ pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
+ pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
+ pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
+ pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
+ pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
+
+ pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
+ pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
+ pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
+
+end
+```
+
+After you have created your `Podfile`, you are ready to install the React Native pod.
+
+```shell
+$ pod install
+```
+
+You should see output such as:
+
+```
+Analyzing dependencies
+Fetching podspec for `React` from `../node_modules/react-native`
+Downloading dependencies
+Installing React (0.62.0)
+Generating Pods project
+Integrating client project
+Sending stats
+Pod installation complete! There are 3 dependencies from the Podfile and 1 total pod installed.
+```
+
+> If this fails with errors mentioning `xcrun`, make sure that in Xcode in **Preferences > Locations** the Command Line Tools are assigned.
+
+
+
+### Code integration
+
+Now we will actually modify the native iOS application to integrate React Native. For our 2048 sample app, we will add a "High Score" screen in React Native.
+
+#### The React Native component
+
+The first bit of code we will write is the actual React Native code for the new "High Score" screen that will be integrated into our application.
+
+##### 1. Create a `index.js` file
+
+First, create an empty `index.js` file in the root of your React Native project.
+
+`index.js` is the starting point for React Native applications, and it is always required. It can be a small file that `require`s other file that are part of your React Native component or application, or it can contain all the code that is needed for it. In our case, we will put everything in `index.js`.
+
+##### 2. Add your React Native code
+
+In your `index.js`, create your component. In our sample here, we will add a `` component within a styled ``
+
+```jsx
+import React from 'react';
+import {
+ AppRegistry,
+ StyleSheet,
+ Text,
+ View
+} from 'react-native';
+
+const RNHighScores = ({ scores }) => {
+ const contents = scores.map((score) => (
+
+ {score.name}:{score.value}
+ {'\n'}
+
+ ));
+ return (
+
+
+ 2048 High Scores!
+
+ {contents}
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ backgroundColor: '#FFFFFF'
+ },
+ highScoresTitle: {
+ fontSize: 20,
+ textAlign: 'center',
+ margin: 10
+ },
+ scores: {
+ textAlign: 'center',
+ color: '#333333',
+ marginBottom: 5
+ }
+});
+
+// Module name
+AppRegistry.registerComponent('RNHighScores', () => RNHighScores);
+```
+
+> `RNHighScores` is the name of your module that will be used when you add a view to React Native from within your iOS application.
+
+#### The Magic: `RCTRootView`
+
+Now that your React Native component is created via `index.js`, you need to add that component to a new or existing `ViewController`. The easiest path to take is to optionally create an event path to your component and then add that component to an existing `ViewController`.
+
+We will tie our React Native component with a new native view in the `ViewController` that will actually contain it called `RCTRootView` .
+
+##### 1. Create an Event Path
+
+You can add a new link on the main game menu to go to the "High Score" React Native page.
+
+
+
+##### 2. Event Handler
+
+We will now add an event handler from the menu link. A method will be added to the main `ViewController` of your application. This is where `RCTRootView` comes into play.
+
+When you build a React Native application, you use the [Metro bundler][metro] to create an `index.bundle` that will be served by the React Native server. Inside `index.bundle` will be our `RNHighScore` module. So, we need to point our `RCTRootView` to the location of the `index.bundle` resource (via `NSURL`) and tie it to the module.
+
+We will, for debugging purposes, log that the event handler was invoked. Then, we will create a string with the location of our React Native code that exists inside the `index.bundle`. Finally, we will create the main `RCTRootView`. Notice how we provide `RNHighScores` as the `moduleName` that we created [above](#the-react-native-component) when writing the code for our React Native component.
+
+First `import` the `RCTRootView` header.
+
+```objectivec
+#import
+```
+
+> The `initialProperties` are here for illustration purposes so we have some data for our high score screen. In our React Native component, we will use `this.props` to get access to that data.
+
+```objectivec
+- (IBAction)highScoreButtonPressed:(id)sender {
+ NSLog(@"High Score Button Pressed");
+ NSURL *jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.bundle?platform=ios"];
+
+ RCTRootView *rootView =
+ [[RCTRootView alloc] initWithBundleURL: jsCodeLocation
+ moduleName: @"RNHighScores"
+ initialProperties:
+ @{
+ @"scores" : @[
+ @{
+ @"name" : @"Alex",
+ @"value": @"42"
+ },
+ @{
+ @"name" : @"Joel",
+ @"value": @"10"
+ }
+ ]
+ }
+ launchOptions: nil];
+ UIViewController *vc = [[UIViewController alloc] init];
+ vc.view = rootView;
+ [self presentViewController:vc animated:YES completion:nil];
+}
+```
+
+> Note that `RCTRootView initWithURL` starts up a new JSC VM. To save resources and simplify the communication between RN views in different parts of your native app, you can have multiple views powered by React Native that are associated with a single JS runtime. To do that, instead of using `[RCTRootView alloc] initWithURL`, use [`RCTBridge initWithBundleURL`](https://github.com/facebook/react-native/blob/master/React/Base/RCTBridge.h#L93) to create a bridge and then use `RCTRootView initWithBridge`.
+
+> When moving your app to production, the `NSURL` can point to a pre-bundled file on disk via something like `[[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];`. You can use the `react-native-xcode.sh` script in `node_modules/react-native/scripts/` to generate that pre-bundled file.
+
+##### 3. Wire Up
+
+Wire up the new link in the main menu to the newly added event handler method.
+
+
+
+> One of the easier ways to do this is to open the view in the storyboard and right click on the new link. Select something such as the `Touch Up Inside` event, drag that to the storyboard and then select the created method from the list provided.
+
+### Test your integration
+
+You have now done all the basic steps to integrate React Native with your current application. Now we will start the [Metro bundler][metro] to build the `index.bundle` package and the server running on `localhost` to serve it.
+
+##### 1. Add App Transport Security exception
+
+Apple has blocked implicit cleartext HTTP resource loading. So we need to add the following our project's `Info.plist` (or equivalent) file.
+
+```xml
+NSAppTransportSecurity
+
+ NSExceptionDomains
+
+ localhost
+
+ NSTemporaryExceptionAllowsInsecureHTTPLoads
+
+
+
+
+```
+
+> App Transport Security is good for your users. Make sure to re-enable it prior to releasing your app for production.
+
+##### 2. Run the packager
+
+To run your app, you need to first start the development server. To do this, run the following command in the root directory of your React Native project:
+
+
+
+
+```shell
+npm start
+```
+
+
+
+
+```shell
+yarn start
+```
+
+
+
+
+##### 3. Run the app
+
+If you are using Xcode or your favorite editor, build and run your native iOS application as normal. Alternatively, you can run the app from the command line using:
+
+```
+# From the root of your project
+$ npx react-native run-ios
+```
+
+In our sample application, you should see the link to the "High Scores" and then when you click on that you will see the rendering of your React Native component.
+
+Here is the _native_ application home screen:
+
+
+
+Here is the _React Native_ high score screen:
+
+
+
+> If you are getting module resolution issues when running your application please see [this GitHub issue](https://github.com/facebook/react-native/issues/4968) for information and possible resolution. [This comment](https://github.com/facebook/react-native/issues/4968#issuecomment-220941717) seemed to be the latest possible resolution.
+
+### Now what?
+
+At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.
+
+[metro]: https://facebook.github.io/metro/
diff --git a/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-swift.md b/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-swift.md
new file mode 100644
index 00000000000..a1c8ea18456
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_integration-with-exisiting-apps-swift.md
@@ -0,0 +1,348 @@
+import M1Cocoapods from './\_markdown-m1-cocoapods.mdx';
+
+## Key Concepts
+
+The keys to integrating React Native components into your iOS application are to:
+
+1. Set up React Native dependencies and directory structure.
+2. Understand what React Native components you will use in your app.
+3. Add these components as dependencies using CocoaPods.
+4. Develop your React Native components in JavaScript.
+5. Add a `RCTRootView` to your iOS app. This view will serve as the container for your React Native component.
+6. Start the React Native server and run your native application.
+7. Verify that the React Native aspect of your application works as expected.
+
+## Prerequisites
+
+Follow the React Native CLI Quickstart in the [environment setup guide](environment-setup) to configure your development environment for building React Native apps for iOS.
+
+### 1. Set up directory structure
+
+To ensure a smooth experience, create a new folder for your integrated React Native project, then copy your existing iOS project to a `/ios` subfolder.
+
+### 2. Install JavaScript dependencies
+
+Go to the root directory for your project and create a new `package.json` file with the following contents:
+
+```
+{
+ "name": "MyReactNativeApp",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "start": "yarn react-native start"
+ }
+}
+```
+
+Next, make sure you have [installed the yarn package manager](https://yarnpkg.com/lang/en/docs/install/).
+
+Install the `react` and `react-native` packages. Open a terminal or command prompt, then navigate to the directory with your `package.json` file and run:
+
+```shell
+$ yarn add react-native
+```
+
+This will print a message similar to the following (scroll up in the yarn output to see it):
+
+> warning "react-native@0.52.2" has unmet peer dependency "react@16.2.0".
+
+This is OK, it means we also need to install React:
+
+```shell
+$ yarn add react@version_printed_above
+```
+
+Yarn has created a new `/node_modules` folder. This folder stores all the JavaScript dependencies required to build your project.
+
+Add `node_modules/` to your `.gitignore` file.
+
+### 3. Install CocoaPods
+
+[CocoaPods](http://cocoapods.org) is a package management tool for iOS and macOS development. We use it to add the actual React Native framework code locally into your current project.
+
+We recommend installing CocoaPods using [Homebrew](http://brew.sh/).
+
+```shell
+$ brew install cocoapods
+```
+
+> It is technically possible not to use CocoaPods, but that would require manual library and linker additions that would overly complicate this process.
+
+## Adding React Native to your app
+
+Assume the [app for integration](https://github.com/JoelMarcey/swift-2048) is a [2048](https://en.wikipedia.org/wiki/2048_%28video_game%29) game. Here is what the main menu of the native application looks like without React Native.
+
+
+
+### Command Line Tools for Xcode
+
+Install the Command Line Tools. Choose "Preferences..." in the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
+
+
+
+### Configuring CocoaPods dependencies
+
+Before you integrate React Native into your application, you will want to decide what parts of the React Native framework you would like to integrate. We will use CocoaPods to specify which of these "subspecs" your app will depend on.
+
+The list of supported `subspec`s is available in [`/node_modules/react-native/React.podspec`](https://github.com/facebook/react-native/blob/master/React.podspec). They are generally named by functionality. For example, you will generally always want the `Core` `subspec`. That will get you the `AppRegistry`, `StyleSheet`, `View` and other core React Native libraries. If you want to add the React Native `Text` library (e.g., for `` elements), then you will need the `RCTText` `subspec`. If you want the `Image` library (e.g., for `` elements), then you will need the `RCTImage` `subspec`.
+
+You can specify which `subspec`s your app will depend on in a `Podfile` file. The easiest way to create a `Podfile` is by running the CocoaPods `init` command in the `/ios` subfolder of your project:
+
+```shell
+$ pod init
+```
+
+The `Podfile` will contain a boilerplate setup that you will tweak for your integration purposes.
+
+> The `Podfile` version changes depending on your version of `react-native`. Refer to https://react-native-community.github.io/upgrade-helper/ for the specific version of `Podfile` you should be using.
+
+Ultimately, your `Podfile` should look something similar to this:
+
+```
+source 'https://github.com/CocoaPods/Specs.git'
+
+# Required for Swift apps
+platform :ios, '8.0'
+use_frameworks!
+
+# The target name is most likely the name of your project.
+target 'swift-2048' do
+
+ # Your 'node_modules' directory is probably in the root of your project,
+ # but if not, adjust the `:path` accordingly
+ pod 'React', :path => '../node_modules/react-native', :subspecs => [
+ 'Core',
+ 'CxxBridge', # Include this for RN >= 0.47
+ 'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43
+ 'RCTText',
+ 'RCTNetwork',
+ 'RCTWebSocket', # needed for debugging
+ # Add any other subspecs you want to use in your project
+ ]
+ # Explicitly include Yoga if you are using RN >= 0.42.0
+ pod "Yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
+
+ # Third party deps podspec link
+ pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
+ pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
+ pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
+
+end
+```
+
+After you have created your `Podfile`, you are ready to install the React Native pod.
+
+```shell
+$ pod install
+```
+
+You should see output such as:
+
+```
+Analyzing dependencies
+Fetching podspec for `React` from `../node_modules/react-native`
+Downloading dependencies
+Installing React (0.62.0)
+Generating Pods project
+Integrating client project
+Sending stats
+Pod installation complete! There are 3 dependencies from the Podfile and 1 total pod installed.
+```
+
+> If this fails with errors mentioning `xcrun`, make sure that in Xcode in **Preferences > Locations** the Command Line Tools are assigned.
+
+> If you get a warning such as "_The `swift-2048 [Debug]` target overrides the `FRAMEWORK_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-swift-2048/Pods-swift-2048.debug.xcconfig`. This can lead to problems with the CocoaPods installation_", then make sure the `Framework Search Paths` in `Build Settings` for both `Debug` and `Release` only contain `$(inherited)`.
+
+
+
+### Code integration
+
+Now we will actually modify the native iOS application to integrate React Native. For our 2048 sample app, we will add a "High Score" screen in React Native.
+
+#### The React Native component
+
+The first bit of code we will write is the actual React Native code for the new "High Score" screen that will be integrated into our application.
+
+##### 1. Create a `index.js` file
+
+First, create an empty `index.js` file in the root of your React Native project.
+
+`index.js` is the starting point for React Native applications, and it is always required. It can be a small file that `require`s other file that are part of your React Native component or application, or it can contain all the code that is needed for it. In our case, we will put everything in `index.js`.
+
+##### 2. Add your React Native code
+
+In your `index.js`, create your component. In our sample here, we will add a `` component within a styled ``
+
+```jsx
+import React from 'react';
+import {
+ AppRegistry,
+ StyleSheet,
+ Text,
+ View
+} from 'react-native';
+
+const RNHighScores = ({ scores }) => {
+ const contents = scores.map((score) => (
+
+ {score.name}:{score.value}
+ {'\n'}
+
+ ));
+ return (
+
+
+ 2048 High Scores!
+
+ {contents}
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center',
+ backgroundColor: '#FFFFFF'
+ },
+ highScoresTitle: {
+ fontSize: 20,
+ textAlign: 'center',
+ margin: 10
+ },
+ scores: {
+ textAlign: 'center',
+ color: '#333333',
+ marginBottom: 5
+ }
+});
+
+// Module name
+AppRegistry.registerComponent('RNHighScores', () => RNHighScores);
+```
+
+> `RNHighScores` is the name of your module that will be used when you add a view to React Native from within your iOS application.
+
+#### The Magic: `RCTRootView`
+
+Now that your React Native component is created via `index.js`, you need to add that component to a new or existing `ViewController`. The easiest path to take is to optionally create an event path to your component and then add that component to an existing `ViewController`.
+
+We will tie our React Native component with a new native view in the `ViewController` that will actually contain it called `RCTRootView` .
+
+##### 1. Create an Event Path
+
+You can add a new link on the main game menu to go to the "High Score" React Native page.
+
+
+
+##### 2. Event Handler
+
+We will now add an event handler from the menu link. A method will be added to the main `ViewController` of your application. This is where `RCTRootView` comes into play.
+
+When you build a React Native application, you use the [Metro bundler][metro] to create an `index.bundle` that will be served by the React Native server. Inside `index.bundle` will be our `RNHighScore` module. So, we need to point our `RCTRootView` to the location of the `index.bundle` resource (via `NSURL`) and tie it to the module.
+
+We will, for debugging purposes, log that the event handler was invoked. Then, we will create a string with the location of our React Native code that exists inside the `index.bundle`. Finally, we will create the main `RCTRootView`. Notice how we provide `RNHighScores` as the `moduleName` that we created [above](#the-react-native-component) when writing the code for our React Native component.
+
+First `import` the `React` library.
+
+```jsx
+import React
+```
+
+> The `initialProperties` are here for illustration purposes so we have some data for our high score screen. In our React Native component, we will use `this.props` to get access to that data.
+
+```swift
+@IBAction func highScoreButtonTapped(sender : UIButton) {
+ NSLog("Hello")
+ let jsCodeLocation = URL(string: "http://localhost:8081/index.bundle?platform=ios")
+ let mockData:NSDictionary = ["scores":
+ [
+ ["name":"Alex", "value":"42"],
+ ["name":"Joel", "value":"10"]
+ ]
+ ]
+
+ let rootView = RCTRootView(
+ bundleURL: jsCodeLocation,
+ moduleName: "RNHighScores",
+ initialProperties: mockData as [NSObject : AnyObject],
+ launchOptions: nil
+ )
+ let vc = UIViewController()
+ vc.view = rootView
+ self.present(vc, animated: true, completion: nil)
+}
+```
+
+> Note that `RCTRootView bundleURL` starts up a new JSC VM. To save resources and simplify the communication between RN views in different parts of your native app, you can have multiple views powered by React Native that are associated with a single JS runtime. To do that, instead of using `RCTRootView bundleURL`, use [`RCTBridge initWithBundleURL`](https://github.com/facebook/react-native/blob/master/React/Base/RCTBridge.h#L89) to create a bridge and then use `RCTRootView initWithBridge`.
+
+> When moving your app to production, the `NSURL` can point to a pre-bundled file on disk via something like `let mainBundle = NSBundle(URLForResource: "main" withExtension:"jsbundle")`. You can use the `react-native-xcode.sh` script in `node_modules/react-native/scripts/` to generate that pre-bundled file.
+
+##### 3. Wire Up
+
+Wire up the new link in the main menu to the newly added event handler method.
+
+
+
+> One of the easier ways to do this is to open the view in the storyboard and right click on the new link. Select something such as the `Touch Up Inside` event, drag that to the storyboard and then select the created method from the list provided.
+
+### Test your integration
+
+You have now done all the basic steps to integrate React Native with your current application. Now we will start the [Metro bundler][metro] to build the `index.bundle` package and the server running on `localhost` to serve it.
+
+##### 1. Add App Transport Security exception
+
+Apple has blocked implicit cleartext HTTP resource loading. So we need to add the following our project's `Info.plist` (or equivalent) file.
+
+```xml
+NSAppTransportSecurity
+
+ NSExceptionDomains
+
+ localhost
+
+ NSTemporaryExceptionAllowsInsecureHTTPLoads
+
+
+
+
+```
+
+> App Transport Security is good for your users. Make sure to re-enable it prior to releasing your app for production.
+
+##### 2. Run the packager
+
+To run your app, you need to first start the development server. To do this, run the following command in the root directory of your React Native project:
+
+```shell
+$ npm start
+```
+
+##### 3. Run the app
+
+If you are using Xcode or your favorite editor, build and run your native iOS application as normal. Alternatively, you can run the app from the command line using:
+
+```
+# From the root of your project
+$ npx react-native run-ios
+```
+
+In our sample application, you should see the link to the "High Scores" and then when you click on that you will see the rendering of your React Native component.
+
+Here is the _native_ application home screen:
+
+
+
+Here is the _React Native_ high score screen:
+
+
+
+> If you are getting module resolution issues when running your application please see [this GitHub issue](https://github.com/facebook/react-native/issues/4968) for information and possible resolution. [This comment](https://github.com/facebook/react-native/issues/4968#issuecomment-220941717) seemed to be the latest possible resolution.
+
+### Now what?
+
+At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.
+
+[metro]: https://facebook.github.io/metro/
diff --git a/website/versioned_docs/version-0.70/_integration-with-existing-apps-kotlin.md b/website/versioned_docs/version-0.70/_integration-with-existing-apps-kotlin.md
new file mode 100644
index 00000000000..9500da50e71
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_integration-with-existing-apps-kotlin.md
@@ -0,0 +1,381 @@
+## Key Concepts
+
+The keys to integrating React Native components into your Android application are to:
+
+1. Set up React Native dependencies and directory structure.
+2. Develop your React Native components in JavaScript.
+3. Add a `ReactRootView` to your Android app. This view will serve as the container for your React Native component.
+4. Start the React Native server and run your native application.
+5. Verify that the React Native aspect of your application works as expected.
+
+## Prerequisites
+
+Follow the React Native CLI Quickstart in the [environment setup guide](environment-setup) to configure your development environment for building React Native apps for Android.
+
+### 1. Set up directory structure
+
+To ensure a smooth experience, create a new folder for your integrated React Native project, then copy your existing Android project to an `/android` subfolder.
+
+### 2. Install JavaScript dependencies
+
+Go to the root directory for your project and create a new `package.json` file with the following contents:
+
+```
+{
+ "name": "MyReactNativeApp",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "start": "yarn react-native start"
+ }
+}
+```
+
+Next, make sure you have [installed the yarn package manager](https://yarnpkg.com/lang/en/docs/install/).
+
+Install the `react` and `react-native` packages. Open a terminal or command prompt, then navigate to the directory with your `package.json` file and run:
+
+```shell
+$ yarn add react-native
+```
+
+This will print a message similar to the following (scroll up in the yarn output to see it):
+
+> warning "react-native@0.52.2" has unmet peer dependency "react@16.2.0".
+
+This is OK, it means we also need to install React:
+
+```shell
+$ yarn add react@version_printed_above
+```
+
+Yarn has created a new `/node_modules` folder. This folder stores all the JavaScript dependencies required to build your project.
+
+Add `node_modules/` to your `.gitignore` file.
+
+## Adding React Native to your app
+
+### Configuring maven
+
+Add the React Native and JSC dependency to your app's `build.gradle` file:
+
+```gradle
+dependencies {
+ implementation "com.android.support:appcompat-v7:27.1.1"
+ ...
+ implementation "com.facebook.react:react-native:+" // From node_modules
+ implementation "org.webkit:android-jsc:+"
+}
+```
+
+> If you want to ensure that you are always using a specific React Native version in your native build, replace `+` with an actual React Native version you've downloaded from `npm`.
+
+Add an entry for the local React Native and JSC maven directories to the top-level `settings.gradle`. Be sure to add it to the “dependencyResolutionManagement” block, above other maven repositories:
+
+```gradle
+dependencyResolutionManagement {
+ ...
+ repositories {
+ ...
+ maven {
+ url "$rootDir/../node_modules/react-native/android"
+ }
+ maven {
+ url("$rootDir/../node_modules/jsc-android/dist")
+ }
+ }
+}
+```
+
+> If your project has the dependency repositories configured in the top-level `build.gradle`, be sure to add the entries to the “allprojects” block above other maven repositories:
+
+```gradle
+allprojects {
+ repositories {
+ maven {
+ // All of React Native (JS, Android binaries) is installed from npm
+ url "$rootDir/../node_modules/react-native/android"
+ }
+ maven {
+ // Android JSC is installed from npm
+ url("$rootDir/../node_modules/jsc-android/dist")
+ }
+ ...
+ }
+ ...
+}
+```
+
+> Make sure that the path is correct! You shouldn’t run into any “Failed to resolve: com.facebook.react:react-native:0.x.x" errors after running Gradle sync in Android Studio.
+
+### Enable native modules autolinking
+
+To use the power of [autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md), we have to apply it a few places. First add the following entry to `settings.gradle`:
+
+```gradle
+apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
+```
+
+Next add the following entry at the very bottom of the `app/build.gradle`:
+
+```gradle
+apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
+```
+
+### Configuring permissions
+
+Next, make sure you have the Internet permission in your `AndroidManifest.xml`:
+
+
+
+If you need to access to the `DevSettingsActivity` add to your `AndroidManifest.xml`:
+
+
+
+This is only used in dev mode when reloading JavaScript from the development server, so you can strip this in release builds if you need to.
+
+### Cleartext Traffic (API level 28+)
+
+> Starting with Android 9 (API level 28), cleartext traffic is disabled by default; this prevents your application from connecting to the [Metro bundler][metro]. The changes below allow cleartext traffic in debug builds.
+
+#### 1. Apply the `usesCleartextTraffic` option to your Debug `AndroidManifest.xml`
+
+```xml
+
+
+
+
+
+```
+
+This is not required for Release builds.
+
+To learn more about Network Security Config and the cleartext traffic policy [see this link](https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted).
+
+### Code integration
+
+Now we will actually modify the native Android application to integrate React Native.
+
+#### The React Native component
+
+The first bit of code we will write is the actual React Native code for the new "High Score" screen that will be integrated into our application.
+
+##### 1. Create a `index.js` file
+
+First, create an empty `index.js` file in the root of your React Native project.
+
+`index.js` is the starting point for React Native applications, and it is always required. It can be a small file that `require`s other file that are part of your React Native component or application, or it can contain all the code that is needed for it. In our case, we will put everything in `index.js`.
+
+##### 2. Add your React Native code
+
+In your `index.js`, create your component. In our sample here, we will add a `` component within a styled ``:
+
+```jsx
+import React from 'react';
+import {
+ AppRegistry,
+ StyleSheet,
+ Text,
+ View
+} from 'react-native';
+
+const HelloWorld = () => {
+ return (
+
+ Hello, World
+
+ );
+};
+var styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center'
+ },
+ hello: {
+ fontSize: 20,
+ textAlign: 'center',
+ margin: 10
+ }
+});
+
+AppRegistry.registerComponent(
+ 'MyReactNativeApp',
+ () => HelloWorld
+);
+```
+
+##### 3. Configure permissions for development error overlay
+
+If your app is targeting the Android `API level 23` or greater, make sure you have the permission `android.permission.SYSTEM_ALERT_WINDOW` enabled for the development build. You can check this with `Settings.canDrawOverlays(this)`. This is required in dev builds because React Native development errors must be displayed above all the other windows. Due to the new permissions system introduced in the API level 23 (Android M), the user needs to approve it. This can be achieved by adding the following code to your Activity's in `onCreate()` method.
+
+```kotlin
+companion object {
+ const val OVERLAY_PERMISSION_REQ_CODE = 1 // Choose any value
+}
+
+...
+
+if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ if(!Settings.canDrawOverlays(this)) {
+ val intent = Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,
+ Uri.parse("package: $packageName"))
+ startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
+ }
+}
+```
+
+Finally, the `onActivityResult()` method (as shown in the code below) has to be overridden to handle the permission Accepted or Denied cases for consistent UX. Also, for integrating Native Modules which use `startActivityForResult`, we need to pass the result to the `onActivityResult` method of our `ReactInstanceManager` instance.
+
+```kotlin
+override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
+ if (requestCode == OVERLAY_PERMISSION_REQ_CODE) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ if (!Settings.canDrawOverlays(this)) {
+ // SYSTEM_ALERT_WINDOW permission not granted
+ }
+ }
+ }
+ reactInstanceManager?.onActivityResult(this, requestCode, resultCode, data)
+}
+```
+
+#### The Magic: `ReactRootView`
+
+Let's add some native code in order to start the React Native runtime and tell it to render our JS component. To do this, we're going to create an `Activity` that creates a `ReactRootView`, starts a React application inside it and sets it as the main content view.
+
+> If you are targeting Android version <5, use the `AppCompatActivity` class from the `com.android.support:appcompat` package instead of `Activity`.
+
+```kotlin
+class MyReactActivity : Activity(), DefaultHardwareBackBtnHandler {
+ private lateinit var reactRootView: ReactRootView
+ private lateinit var reactInstanceManager: ReactInstanceManager
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ SoLoader.init(this, false)
+ reactRootView = ReactRootView(this)
+ val packages: List = PackageList(application).packages
+ // Packages that cannot be autolinked yet can be added manually here, for example:
+ // packages.add(MyReactNativePackage())
+ // Remember to include them in `settings.gradle` and `app/build.gradle` too.
+ reactInstanceManager = ReactInstanceManager.builder()
+ .setApplication(application)
+ .setCurrentActivity(this)
+ .setBundleAssetName("index.android.bundle")
+ .setJSMainModulePath("index")
+ .addPackages(packages)
+ .setUseDeveloperSupport(BuildConfig.DEBUG)
+ .setInitialLifecycleState(LifecycleState.RESUMED)
+ .build()
+ // The string here (e.g. "MyReactNativeApp") has to match
+ // the string in AppRegistry.registerComponent() in index.js
+ reactRootView?.startReactApplication(reactInstanceManager, "MyReactNativeApp", null)
+ setContentView(reactRootView)
+ }
+
+ override fun invokeDefaultOnBackPressed() {
+ super.onBackPressed()
+ }
+}
+```
+
+> If you are using a starter kit for React Native, replace the "HelloWorld" string with the one in your index.js file (it’s the first argument to the `AppRegistry.registerComponent()` method).
+
+Perform a “Sync Project files with Gradle” operation.
+
+If you are using Android Studio, use `Alt + Enter` to add all missing imports in your MyReactActivity class. Be careful to use your package’s `BuildConfig` and not the one from the `facebook` package.
+
+We need set the theme of `MyReactActivity` to `Theme.AppCompat.Light.NoActionBar` because some React Native UI components rely on this theme.
+
+```xml
+
+
+```
+
+> A `ReactInstanceManager` can be shared by multiple activities and/or fragments. You will want to make your own `ReactFragment` or `ReactActivity` and have a singleton _holder_ that holds a `ReactInstanceManager`. When you need the `ReactInstanceManager` (e.g., to hook up the `ReactInstanceManager` to the lifecycle of those Activities or Fragments) use the one provided by the singleton.
+
+Next, we need to pass some activity lifecycle callbacks to the `ReactInstanceManager` and `ReactRootView`:
+
+```kotlin
+override fun onPause() {
+ super.onPause()
+ reactInstanceManager.onHostPause(this)
+}
+
+override fun onResume() {
+ super.onResume()
+ reactInstanceManager.onHostResume(this, this)
+}
+
+override fun onDestroy() {
+ super.onDestroy()
+ reactInstanceManager.onHostDestroy(this)
+ reactRootView.unmountReactApplication()
+}
+```
+
+We also need to pass back button events to React Native:
+
+```kotlin
+override fun onBackPressed() {
+ reactInstanceManager.onBackPressed()
+ super.onBackPressed()
+}
+```
+
+This allows JavaScript to control what happens when the user presses the hardware back button (e.g. to implement navigation). When JavaScript doesn't handle the back button press, your `invokeDefaultOnBackPressed` method will be called. By default this finishes your `Activity`.
+
+Finally, we need to hook up the dev menu. By default, this is activated by (rage) shaking the device, but this is not very useful in emulators. So we make it show when you press the hardware menu button (use `Ctrl + M` if you're using Android Studio emulator):
+
+```kotlin
+override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
+ if (keyCode == KeyEvent.KEYCODE_MENU && reactInstanceManager != null) {
+ reactInstanceManager.showDevOptionsDialog()
+ return true
+ }
+ return super.onKeyUp(keyCode, event)
+}
+```
+
+Now your activity is ready to run some JavaScript code.
+
+### Test your integration
+
+You have now done all the basic steps to integrate React Native with your current application. Now we will start the [Metro bundler][metro] to build the `index.bundle` package and the server running on localhost to serve it.
+
+##### 1. Run the packager
+
+To run your app, you need to first start the development server. To do this, run the following command in the root directory of your React Native project:
+
+```shell
+$ yarn start
+```
+
+##### 2. Run the app
+
+Now build and run your Android app as normal.
+
+Once you reach your React-powered activity inside the app, it should load the JavaScript code from the development server and display:
+
+
+
+### Creating a release build in Android Studio
+
+You can use Android Studio to create your release builds too! It’s as quick as creating release builds of your previously-existing native Android app. There’s one additional step, which you’ll have to do before every release build. You need to execute the following to create a React Native bundle, which will be included with your native Android app:
+
+```shell
+$ npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/com/your-company-name/app-package-name/src/main/assets/index.android.bundle --assets-dest android/com/your-company-name/app-package-name/src/main/res/
+```
+
+> Don’t forget to replace the paths with correct ones and create the assets folder if it doesn’t exist.
+
+Now, create a release build of your native app from within Android Studio as usual and you should be good to go!
+
+### Now what?
+
+At this point you can continue developing your app as usual. Refer to our [debugging](debugging) and [deployment](running-on-device) docs to learn more about working with React Native.
+
+[metro]: https://facebook.github.io/metro/
diff --git a/website/versioned_docs/version-0.70/_markdown-m1-cocoapods.mdx b/website/versioned_docs/version-0.70/_markdown-m1-cocoapods.mdx
new file mode 100644
index 00000000000..41161b15791
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_markdown-m1-cocoapods.mdx
@@ -0,0 +1,11 @@
+
+ Note for Mac M1 users
+
+Mac M1 architecture is not directly compatible with Cocoapods. If you encounter issues when installing pods, you can solve it by running:
+
+- `sudo arch -x86_64 gem install ffi`
+- `arch -x86_64 pod install`
+
+These commands install the `ffi` package, to load dynamically-linked libraries and let you run the `pod install` properly, and runs `pod install` with the proper architecture.
+
+
diff --git a/website/versioned_docs/version-0.70/_markdown-new-architecture-warning.mdx b/website/versioned_docs/version-0.70/_markdown-new-architecture-warning.mdx
new file mode 100644
index 00000000000..d52c490153b
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_markdown-new-architecture-warning.mdx
@@ -0,0 +1,7 @@
+:::caution
+
+This documentation is still **experimental** and details are subject to changes as we iterate. Feel free to share your feedback on the [discussion inside the working group](https://github.com/reactwg/react-native-new-architecture/discussions/8) for this page.
+
+Moreover, it contains several **manual steps**. Please note that this won't be representative of the final developer experience once the New Architecture is stable. We're working on tools, templates and libraries to help you get started fast on the New Architecture, without having to go through the whole setup.
+
+:::
diff --git a/website/versioned_docs/version-0.70/_remove-global-cli.md b/website/versioned_docs/version-0.70/_remove-global-cli.md
new file mode 100644
index 00000000000..08d0d9ba3c1
--- /dev/null
+++ b/website/versioned_docs/version-0.70/_remove-global-cli.md
@@ -0,0 +1,5 @@
+> If you previously installed a global `react-native-cli` package, please remove it as it may cause unexpected issues:
+>
+> ```shell
+> npm uninstall -g react-native-cli @react-native-community/cli
+> ```
diff --git a/website/versioned_docs/version-0.70/accessibility.md b/website/versioned_docs/version-0.70/accessibility.md
new file mode 100644
index 00000000000..17f444c3552
--- /dev/null
+++ b/website/versioned_docs/version-0.70/accessibility.md
@@ -0,0 +1,345 @@
+---
+id: accessibility
+title: Accessibility
+description: Create mobile apps accessible to assistive technology with React Native's suite of APIs designed to work with Android and iOS.
+---
+
+Both Android and iOS provide APIs for integrating apps with assistive technologies like the bundled screen readers VoiceOver (iOS) and TalkBack (Android). React Native has complementary APIs that let your app accommodate all users.
+
+:::info
+Android and iOS differ slightly in their approaches, and thus the React Native implementations may vary by platform.
+:::
+
+## Accessibility properties
+
+### `accessible`
+
+When `true`, indicates that the view is an accessibility element. When a view is an accessibility element, it groups its children into a single selectable component. By default, all touchable elements are accessible.
+
+On Android, `accessible={true}` property for a react-native View will be translated into native `focusable={true}`.
+
+```jsx
+
+ text one
+ text two
+
+```
+
+In the above example, we can't get accessibility focus separately on 'text one' and 'text two'. Instead we get focus on a parent view with 'accessible' property.
+
+### `accessibilityLabel`
+
+When a view is marked as accessible, it is a good practice to set an accessibilityLabel on the view, so that people who use VoiceOver know what element they have selected. VoiceOver will read this string when a user selects the associated element.
+
+To use, set the `accessibilityLabel` property to a custom string on your View, Text or Touchable:
+
+```jsx
+
+
+ Press me!
+
+
+```
+
+In the above example, the `accessibilityLabel` on the TouchableOpacity element would default to "Press me!". The label is constructed by concatenating all Text node children separated by spaces.
+
+### `accessibilityLabelledBy`
Android
+
+A reference to another element [nativeID](view.md#nativeid) used to build complex forms.
+The value of `accessibilityLabelledBy` should match the `nativeID` of the related element:
+
+```jsx
+
+ Label for Input Field
+
+
+```
+
+In the above example, the screenreader announces `Input, Edit Box for Label for Input Field` when focusing on the TextInput.
+
+### `accessibilityHint`
+
+An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not clear from the accessibility label.
+
+To use, set the `accessibilityHint` property to a custom string on your View, Text or Touchable:
+
+```jsx
+
+
+ Back
+
+
+```
+
+
iOS
+
+In the above example, VoiceOver will read the hint after the label, if the user has hints enabled in the device's VoiceOver settings. Read more about guidelines for `accessibilityHint` in the [iOS Developer Docs](https://developer.apple.com/documentation/objectivec/nsobject/1615093-accessibilityhint)
+
+
Android
+
+In the above example, TalkBack will read the hint after the label. At this time, hints cannot be turned off on Android.
+
+### `accessibilityLanguage`
iOS
+
+By using the `accessibilityLanguage` property, the screen reader will understand which language to use while reading the element's **label**, **value** and **hint**. The provided string value must follow the [BCP 47 specification](https://www.rfc-editor.org/info/bcp47).
+
+```jsx
+
+ 🍕
+
+```
+
+### `accessibilityIgnoresInvertColors`
iOS
+
+Inverting screen colors is an Accessibility feature that makes the iPhone and iPad easier on the eyes for some people with a sensitivity to brightness, easier to distinguish for some people with color blindness, and easier to make out for some people with low vision. However, sometimes you have views such as photos that you don't want to be inverted. In this case, you can set this property to be `true` so that these specific views won't have their colors inverted.
+
+### `accessibilityLiveRegion`
Android
+
+When components dynamically change, we want TalkBack to alert the end user. This is made possible by the `accessibilityLiveRegion` property. It can be set to `none`, `polite` and `assertive`:
+
+- **none** Accessibility services should not announce changes to this view.
+- **polite** Accessibility services should announce changes to this view.
+- **assertive** Accessibility services should interrupt ongoing speech to immediately announce changes to this view.
+
+```jsx
+
+
+ Click me
+
+
+
+ Clicked {count} times
+
+```
+
+In the above example method `addOne` changes the state variable `count`. As soon as an end user clicks the TouchableWithoutFeedback, TalkBack reads text in the Text view because of its `accessibilityLiveRegion="polite"` property.
+
+### `accessibilityRole`
+
+`accessibilityRole` communicates the purpose of a component to the user of an assistive technology.
+
+`accessibilityRole` can be one of the following:
+
+- **adjustable** Used when an element can be "adjusted" (e.g. a slider).
+- **alert** Used when an element contains important text to be presented to the user.
+- **button** Used when the element should be treated as a button.
+- **checkbox** Used when an element represents a checkbox which can be checked, unchecked, or have mixed checked state.
+- **combobox** Used when an element represents a combo box, which allows the user to select among several choices.
+- **header** Used when an element acts as a header for a content section (e.g. the title of a navigation bar).
+- **image** Used when the element should be treated as an image. Can be combined with button or link, for example.
+- **imagebutton** Used when the element should be treated as a button and is also an image.
+- **keyboardkey** Used when the element acts as a keyboard key.
+- **link** Used when the element should be treated as a link.
+- **menu** Used when the component is a menu of choices.
+- **menubar** Used when a component is a container of multiple menus.
+- **menuitem** Used to represent an item within a menu.
+- **none** Used when the element has no role.
+- **progressbar** Used to represent a component which indicates progress of a task.
+- **radio** Used to represent a radio button.
+- **radiogroup** Used to represent a group of radio buttons.
+- **scrollbar** Used to represent a scroll bar.
+- **search** Used when the text field element should also be treated as a search field.
+- **spinbutton** Used to represent a button which opens a list of choices.
+- **summary** Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.
+- **switch** Used to represent a switch which can be turned on and off.
+- **tab** Used to represent a tab.
+- **tablist** Used to represent a list of tabs.
+- **text** Used when the element should be treated as static text that cannot change.
+- **timer** Used to represent a timer.
+- **togglebutton** Used to represent a toggle button. Should be used with accessibilityState checked to indicate if the button is toggled on or off.
+- **toolbar** Used to represent a tool bar (a container of action buttons or components).
+
+### `accessibilityState`
+
+Describes the current state of a component to the user of an assistive technology.
+
+`accessibilityState` is an object. It contains the following fields:
+
+| Name | Description | Type | Required |
+| -------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------ | -------- |
+| disabled | Indicates whether the element is disabled or not. | boolean | No |
+| selected | Indicates whether a selectable element is currently selected or not. | boolean | No |
+| checked | Indicates the state of a checkable element. This field can either take a boolean or the "mixed" string to represent mixed checkboxes. | boolean or 'mixed' | No |
+| busy | Indicates whether an element is currently busy or not. | boolean | No |
+| expanded | Indicates whether an expandable element is currently expanded or collapsed. | boolean | No |
+
+To use, set the `accessibilityState` to an object with a specific definition.
+
+### `accessibilityValue`
+
+Represents the current value of a component. It can be a textual description of a component's value, or for range-based components, such as sliders and progress bars, it contains range information (minimum, current, and maximum).
+
+`accessibilityValue` is an object. It contains the following fields:
+
+| Name | Description | Type | Required |
+| ---- | ---------------------------------------------------------------------------------------------- | ------- | ------------------------- |
+| min | The minimum value of this component's range. | integer | Required if `now` is set. |
+| max | The maximum value of this component's range. | integer | Required if `now` is set. |
+| now | The current value of this component's range. | integer | No |
+| text | A textual description of this component's value. Will override `min`, `now`, and `max` if set. | string | No |
+
+### `accessibilityViewIsModal`
iOS
+
+A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver.
+
+For example, in a window that contains sibling views `A` and `B`, setting `accessibilityViewIsModal` to `true` on view `B` causes VoiceOver to ignore the elements in the view `A`. On the other hand, if view `B` contains a child view `C` and you set `accessibilityViewIsModal` to `true` on view `C`, VoiceOver does not ignore the elements in view `A`.
+
+### `accessibilityElementsHidden`
iOS
+
+A Boolean value indicating whether the accessibility elements contained within this accessibility element are hidden.
+
+For example, in a window that contains sibling views `A` and `B`, setting `accessibilityElementsHidden` to `true` on view `B` causes VoiceOver to ignore the elements in the view `B`. This is similar to the Android property `importantForAccessibility="no-hide-descendants"`.
+
+### `importantForAccessibility`
Android
+
+In the case of two overlapping UI components with the same parent, default accessibility focus can have unpredictable behavior. The `importantForAccessibility` property will resolve this by controlling if a view fires accessibility events and if it is reported to accessibility services. It can be set to `auto`, `yes`, `no` and `no-hide-descendants` (the last value will force accessibility services to ignore the component and all of its children).
+
+```jsx
+
+
+ First layout
+
+
+ Second layout
+
+
+```
+
+In the above example, the `yellow` layout and its descendants are completely invisible to TalkBack and all other accessibility services. So we can use overlapping views with the same parent without confusing TalkBack.
+
+### `onAccessibilityEscape`
iOS
+
+Assign this property to a custom function which will be called when someone performs the "escape" gesture, which is a two finger Z shaped gesture. An escape function should move back hierarchically in the user interface. This can mean moving up or back in a navigation hierarchy or dismissing a modal user interface. If the selected element does not have an `onAccessibilityEscape` function, the system will attempt to traverse up the view hierarchy until it finds a view that does or bonk to indicate it was unable to find one.
+
+### `onAccessibilityTap`
+
+Use this property to assign a custom function to be called when someone activates an accessible element by double tapping on it while it's selected.
+
+### `onMagicTap`
iOS
+
+Assign this property to a custom function which will be called when someone performs the "magic tap" gesture, which is a double-tap with two fingers. A magic tap function should perform the most relevant action a user could take on a component. In the Phone app on iPhone, a magic tap answers a phone call, or ends the current one. If the selected element does not have an `onMagicTap` function, the system will traverse up the view hierarchy until it finds a view that does.
+
+## Accessibility Actions
+
+Accessibility actions allow an assistive technology to programmatically invoke the actions of a component. In order to support accessibility actions, a component must do two things:
+
+- Define the list of actions it supports via the `accessibilityActions` property.
+- Implement an `onAccessibilityAction` function to handle action requests.
+
+The `accessibilityActions` property should contain a list of action objects. Each action object should contain the following fields:
+
+| Name | Type | Required |
+| ----- | ------ | -------- |
+| name | string | Yes |
+| label | string | No |
+
+Actions either represent standard actions, such as clicking a button or adjusting a slider, or custom actions specific to a given component such as deleting an email message. The `name` field is required for both standard and custom actions, but `label` is optional for standard actions.
+
+When adding support for standard actions, `name` must be one of the following:
+
+- `'magicTap'` - iOS only - While VoiceOver focus is on or inside the component, the user double tapped with two fingers.
+- `'escape'` - iOS only - While VoiceOver focus is on or inside the component, the user performed a two finger scrub gesture (left, right, left).
+- `'activate'` - Activate the component. Typically this should perform the same action as when the user touches or clicks the component when not using an assistive technology. This is generated when a screen reader user double taps the component.
+- `'increment'` - Increment an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes upward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume up button.
+- `'decrement'` - Decrement an adjustable component. On iOS, VoiceOver generates this action when the component has a role of `'adjustable'` and the user places focus on it and swipes downward. On Android, TalkBack generates this action when the user places accessibility focus on the component and presses the volume down button.
+- `'longpress'` - Android only - This action is generated when the user places accessibility focus on the component and double tap and holds one finger on the screen. Typically, this should perform the same action as when the user holds down one finger on the component while not using an assistive technology.
+
+The `label` field is optional for standard actions, and is often unused by assistive technologies. For custom actions, it is a localized string containing a description of the action to be presented to the user.
+
+To handle action requests, a component must implement an `onAccessibilityAction` function. The only argument to this function is an event containing the name of the action to perform. The below example from RNTester shows how to create a component which defines and handles several custom actions.
+
+```jsx
+ {
+ switch (event.nativeEvent.actionName) {
+ case 'cut':
+ Alert.alert('Alert', 'cut action success');
+ break;
+ case 'copy':
+ Alert.alert('Alert', 'copy action success');
+ break;
+ case 'paste':
+ Alert.alert('Alert', 'paste action success');
+ break;
+ }
+ }}
+/>
+```
+
+## Checking if a Screen Reader is Enabled
+
+The `AccessibilityInfo` API allows you to determine whether or not a screen reader is currently active. See the [AccessibilityInfo documentation](accessibilityinfo) for details.
+
+## Sending Accessibility Events
Android
+
+Sometimes it is useful to trigger an accessibility event on a UI component (i.e. when a custom view appears on a screen or set accessibility focus to a view). Native UIManager module exposes a method ‘sendAccessibilityEvent’ for this purpose. It takes two arguments: view tag and a type of an event. The supported event types are `typeWindowStateChanged`, `typeViewFocused` and `typeViewClicked`.
+
+```jsx
+import {
+ Platform,
+ UIManager,
+ findNodeHandle
+} from 'react-native';
+
+if (Platform.OS === 'android') {
+ UIManager.sendAccessibilityEvent(
+ findNodeHandle(this),
+ UIManager.AccessibilityEventTypes.typeViewFocused
+ );
+}
+```
+
+## Testing TalkBack Support
Android
+
+To enable TalkBack, go to the Settings app on your Android device or emulator. Tap Accessibility, then TalkBack. Toggle the "Use service" switch to enable or disable it.
+
+Android emulators don't have TalkBack installed by default. You can install TalkBack on your emulator via the Google Play Store. Make sure to choose an emulator with the Google Play store installed. These are available in Android Studio.
+
+You can use the volume key shortcut to toggle TalkBack. To turn on the volume key shortcut, go to the Settings app, then Accessibility. At the top, turn on Volume key shortcut.
+
+To use the volume key shortcut, press both volume keys for 3 seconds to start an accessibility tool.
+
+Additionally, if you prefer, you can toggle TalkBack via command line with:
+
+```shell
+# disable
+adb shell settings put secure enabled_accessibility_services com.android.talkback/com.google.android.marvin.talkback.TalkBackService
+
+# enable
+adb shell settings put secure enabled_accessibility_services com.google.android.marvin.talkback/com.google.android.marvin.talkback.TalkBackService
+```
+
+## Testing VoiceOver Support
iOS
+
+To enable VoiceOver, go to the Settings app on your iOS device (it's not available for simulator). Tap General, then Accessibility. There you will find many tools that people use to make their devices more usable, such as bolder text, increased contrast, and VoiceOver.
+
+To enable VoiceOver, tap on VoiceOver under "Vision" and toggle the switch that appears at the top.
+
+At the very bottom of the Accessibility settings, there is an "Accessibility Shortcut". You can use this to toggle VoiceOver by triple clicking the Home button.
+
+## Additional Resources
+
+- [Making React Native Apps Accessible](https://engineering.fb.com/ios/making-react-native-apps-accessible/)
diff --git a/website/versioned_docs/version-0.70/accessibilityinfo.md b/website/versioned_docs/version-0.70/accessibilityinfo.md
new file mode 100644
index 00000000000..3d0555520b1
--- /dev/null
+++ b/website/versioned_docs/version-0.70/accessibilityinfo.md
@@ -0,0 +1,316 @@
+---
+id: accessibilityinfo
+title: AccessibilityInfo
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+Sometimes it's useful to know whether or not the device has a screen reader that is currently active. The `AccessibilityInfo` API is designed for this purpose. You can use it to query the current state of the screen reader as well as to register to be notified when the state of the screen reader changes.
+
+## Example
+
+
+
+
+```SnackPlayer name=AccessibilityInfo%20Function%20Component%20Example&supportedPlatforms=android,ios
+import React, { useState, useEffect } from "react";
+import { AccessibilityInfo, View, Text, StyleSheet } from "react-native";
+
+const App = () => {
+ const [reduceMotionEnabled, setReduceMotionEnabled] = useState(false);
+ const [screenReaderEnabled, setScreenReaderEnabled] = useState(false);
+
+ useEffect(() => {
+ const reduceMotionChangedSubscription = AccessibilityInfo.addEventListener(
+ "reduceMotionChanged",
+ reduceMotionEnabled => {
+ setReduceMotionEnabled(reduceMotionEnabled);
+ }
+ );
+ const screenReaderChangedSubscription = AccessibilityInfo.addEventListener(
+ "screenReaderChanged",
+ screenReaderEnabled => {
+ setScreenReaderEnabled(screenReaderEnabled);
+ }
+ );
+
+ AccessibilityInfo.isReduceMotionEnabled().then(
+ reduceMotionEnabled => {
+ setReduceMotionEnabled(reduceMotionEnabled);
+ }
+ );
+ AccessibilityInfo.isScreenReaderEnabled().then(
+ screenReaderEnabled => {
+ setScreenReaderEnabled(screenReaderEnabled);
+ }
+ );
+
+ return () => {
+ reduceMotionChangedSubscription.remove();
+ screenReaderChangedSubscription.remove();
+ };
+ }, []);
+
+ return (
+
+
+ The reduce motion is {reduceMotionEnabled ? "enabled" : "disabled"}.
+
+
+ The screen reader is {screenReaderEnabled ? "enabled" : "disabled"}.
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ status: {
+ margin: 30
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=AccessibilityInfo%20Class%20Component%20Example&supportedPlatforms=android,ios
+import React, { Component } from 'react';
+import { AccessibilityInfo, View, Text, StyleSheet } from 'react-native';
+
+class AccessibilityStatusExample extends Component {
+ state = {
+ reduceMotionEnabled: false,
+ screenReaderEnabled: false,
+ };
+
+ componentDidMount() {
+ this.reduceMotionChangedSubscription = AccessibilityInfo.addEventListener(
+ 'reduceMotionChanged',
+ reduceMotionEnabled => {
+ this.setState({ reduceMotionEnabled });
+ }
+ );
+ this.screenReaderChangedSubscription = AccessibilityInfo.addEventListener(
+ 'screenReaderChanged',
+ screenReaderEnabled => {
+ this.setState({ screenReaderEnabled });
+ }
+ );
+
+ AccessibilityInfo.isReduceMotionEnabled().then(reduceMotionEnabled => {
+ this.setState({ reduceMotionEnabled });
+ });
+ AccessibilityInfo.isScreenReaderEnabled().then(screenReaderEnabled => {
+ this.setState({ screenReaderEnabled });
+ });
+ }
+
+ componentWillUnmount() {
+ this.reduceMotionChangedSubscription.remove();
+ this.screenReaderChangedSubscription.remove();
+ }
+
+ render() {
+ return (
+
+
+ The reduce motion is{' '}
+ {this.state.reduceMotionEnabled ? 'enabled' : 'disabled'}.
+
+
+ The screen reader is{' '}
+ {this.state.screenReaderEnabled ? 'enabled' : 'disabled'}.
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ status: {
+ margin: 30,
+ },
+});
+
+export default AccessibilityStatusExample;
+```
+
+
+
+
+---
+
+# Reference
+
+## Methods
+
+### `addEventListener()`
+
+```jsx
+static addEventListener(eventName, handler)
+```
+
+Add an event handler. Supported events:
+
+| Event name | Description |
+| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `accessibilityServiceChanged`
Android
| Fires when some services such as TalkBack, other Android assistive technologies, and third-party accessibility services are enabled. The argument to the event handler is a boolean. The boolean is `true` when a some accessibility services is enabled and `false` otherwise. |
+| `announcementFinished`
iOS
| Fires when the screen reader has finished making an announcement. The argument to the event handler is a dictionary with these keys:
`announcement`: The string announced by the screen reader.
`success`: A boolean indicating whether the announcement was successfully made.
|
+| `boldTextChanged`
iOS
| Fires when the state of the bold text toggle changes. The argument to the event handler is a boolean. The boolean is `true` when bold text is enabled and `false` otherwise. |
+| `grayscaleChanged`
iOS
| Fires when the state of the gray scale toggle changes. The argument to the event handler is a boolean. The boolean is `true` when a gray scale is enabled and `false` otherwise. |
+| `invertColorsChanged`
iOS
| Fires when the state of the invert colors toggle changes. The argument to the event handler is a boolean. The boolean is `true` when invert colors is enabled and `false` otherwise. |
+| `reduceMotionChanged` | Fires when the state of the reduce motion toggle changes. The argument to the event handler is a boolean. The boolean is `true` when a reduce motion is enabled (or when "Transition Animation Scale" in "Developer options" is "Animation off") and `false` otherwise. |
+| `reduceTransparencyChanged`
iOS
| Fires when the state of the reduce transparency toggle changes. The argument to the event handler is a boolean. The boolean is `true` when reduce transparency is enabled and `false` otherwise. |
+| `screenReaderChanged` | Fires when the state of the screen reader changes. The argument to the event handler is a boolean. The boolean is `true` when a screen reader is enabled and `false` otherwise. |
+
+---
+
+### `announceForAccessibility()`
+
+```jsx
+static announceForAccessibility(announcement)
+```
+
+Post a string to be announced by the screen reader.
+
+---
+
+### `announceForAccessibilityWithOptions()`
+
+```jsx
+static announceForAccessibilityWithOptions(announcement, options)
+```
+
+Post a string to be announced by the screen reader with modification options. By default announcements will interrupt any existing speech, but on iOS they can be queued behind existing speech by setting `queue` to `true` in the options object.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------------------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
+| announcement
Required
| string | The string to be announced |
+| options
+
+```jsx
+static getRecommendedTimeoutMillis(originalTimeout)
+```
+
+Gets the timeout in millisecond that the user needs.
+This value is set in "Time to take action (Accessibility timeout)" of "Accessibility" settings.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ---------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------- |
+| originalTimeout
Required
| number | The timeout to return if "Accessibility timeout" is not set. Specify in milliseconds. |
+
+---
+
+### `isAccessibilityServiceEnabled()`
Android
+
+```jsx
+static isAccessibilityServiceEnabled(): Promise
+```
+
+Check whether any accessibility service is enabled. This includes TalkBack but also any third-party accessibility app that may be installed. To only check whether TalkBack is enabled, use [isScreenReaderEnabled](#isscreenreaderenabled). Returns a promise which resolves to a boolean. The result is `true` when some accessibility services is enabled and `false` otherwise.
+
+> **Note**: Please use [isScreenReaderEnabled](#isscreenreaderenabled) if you only want to check the status of TalkBack.
+
+---
+
+### `isBoldTextEnabled()`
iOS
+
+```jsx
+static isBoldTextEnabled()
+```
+
+Query whether a bold text is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when bold text is enabled and `false` otherwise.
+
+---
+
+### `isGrayscaleEnabled()`
iOS
+
+```jsx
+static isGrayscaleEnabled()
+```
+
+Query whether grayscale is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when grayscale is enabled and `false` otherwise.
+
+---
+
+### `isInvertColorsEnabled()`
iOS
+
+```jsx
+static isInvertColorsEnabled()
+```
+
+Query whether invert colors is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when invert colors is enabled and `false` otherwise.
+
+---
+
+### `isReduceMotionEnabled()`
+
+```jsx
+static isReduceMotionEnabled()
+```
+
+Query whether reduce motion is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when reduce motion is enabled and `false` otherwise.
+
+---
+
+### `isReduceTransparencyEnabled()`
iOS
+
+```jsx
+static isReduceTransparencyEnabled()
+```
+
+Query whether reduce transparency is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when a reduce transparency is enabled and `false` otherwise.
+
+---
+
+### `isScreenReaderEnabled()`
+
+```jsx
+static isScreenReaderEnabled()
+```
+
+Query whether a screen reader is currently enabled. Returns a promise which resolves to a boolean. The result is `true` when a screen reader is enabled and `false` otherwise.
+
+---
+
+### `removeEventListener()`
+
+```jsx
+static removeEventListener(eventName, handler)
+```
+
+> **Deprecated.** Use the `remove()` method on the event subscription returned by [`addEventListener()`](#addeventlistener).
+
+---
+
+### `setAccessibilityFocus()`
+
+```jsx
+static setAccessibilityFocus(reactTag)
+```
+
+Set accessibility focus to a React component.
+
+On Android, this calls `UIManager.sendAccessibilityEvent` method with passed `reactTag` and `UIManager.AccessibilityEventTypes.typeViewFocused` arguments.
+
+> **Note**: Make sure that any `View` you want to receive the accessibility focus has `accessible={true}`.
diff --git a/website/versioned_docs/version-0.70/actionsheetios.md b/website/versioned_docs/version-0.70/actionsheetios.md
new file mode 100644
index 00000000000..a56f4629f9e
--- /dev/null
+++ b/website/versioned_docs/version-0.70/actionsheetios.md
@@ -0,0 +1,132 @@
+---
+id: actionsheetios
+title: ActionSheetIOS
+---
+
+Displays native to iOS [Action Sheet](https://developer.apple.com/design/human-interface-guidelines/ios/views/action-sheets/) component.
+
+## Example
+
+```SnackPlayer name=ActionSheetIOS&supportedPlatforms=ios
+import React, { useState } from "react";
+import { ActionSheetIOS, Button, StyleSheet, Text, View } from "react-native";
+
+const App = () => {
+ const [result, setResult] = useState("🔮");
+
+ const onPress = () =>
+ ActionSheetIOS.showActionSheetWithOptions(
+ {
+ options: ["Cancel", "Generate number", "Reset"],
+ destructiveButtonIndex: 2,
+ cancelButtonIndex: 0,
+ userInterfaceStyle: 'dark'
+ },
+ buttonIndex => {
+ if (buttonIndex === 0) {
+ // cancel action
+ } else if (buttonIndex === 1) {
+ setResult(Math.floor(Math.random() * 100) + 1);
+ } else if (buttonIndex === 2) {
+ setResult("🔮");
+ }
+ }
+ );
+
+ return (
+
+ {result}
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center"
+ },
+ result: {
+ fontSize: 64,
+ textAlign: "center"
+ }
+});
+
+export default App;
+```
+
+# Reference
+
+## Methods
+
+### `showActionSheetWithOptions()`
+
+```jsx
+static showActionSheetWithOptions(options, callback)
+```
+
+Display an iOS action sheet. The `options` object must contain one or more of:
+
+- `options` (array of strings) - a list of button titles (required)
+- `cancelButtonIndex` (int) - index of cancel button in `options`
+- `cancelButtonTintColor` (string) - the [color](colors) used for the change the text color of the cancel button
+- `destructiveButtonIndex` (int or array of ints) - indices of destructive buttons in `options`
+- `title` (string) - a title to show above the action sheet
+- `message` (string) - a message to show below the title
+- `anchor` (number) - the node to which the action sheet should be anchored (used for iPad)
+- `tintColor` (string) - the [color](colors) used for non-destructive button titles
+- `disabledButtonIndices` (array of numbers) - a list of button indices which should be disabled
+- `userInterfaceStyle` (string) - the interface style used for the action sheet, can be set to `light` or `dark`, otherwise the default system style will be used
+
+The 'callback' function takes one parameter, the zero-based index of the selected item.
+
+Minimal example:
+
+```jsx
+ActionSheetIOS.showActionSheetWithOptions(
+ {
+ options: ['Cancel', 'Remove'],
+ destructiveButtonIndex: 1,
+ cancelButtonIndex: 0
+ },
+ (buttonIndex) => {
+ if (buttonIndex === 1) {
+ /* destructive action */
+ }
+ }
+);
+```
+
+---
+
+### `dismissActionSheet()`
+
+```jsx
+static dismissActionSheet()
+```
+
+Dismisses the most upper iOS action sheet presented, if no action sheet is present a warning is displayed.
+
+---
+
+### `showShareActionSheetWithOptions()`
+
+```jsx
+static showShareActionSheetWithOptions(options, failureCallback, successCallback)
+```
+
+Display the iOS share sheet. The `options` object should contain one or both of `message` and `url` and can additionally have a `subject` or `excludedActivityTypes`:
+
+- `url` (string) - a URL to share
+- `message` (string) - a message to share
+- `subject` (string) - a subject for the message
+- `excludedActivityTypes` (array) - the activities to exclude from the ActionSheet
+
+> **Note:** If `url` points to a local file, or is a base64-encoded uri, the file it points to will be loaded and shared directly. In this way, you can share images, videos, PDF files, etc. If `url` points to a remote file or address it must conform to URL format as described in [RFC 2396](https://www.ietf.org/rfc/rfc2396.txt). For example, a web URL without a proper protocol (HTTP/HTTPS) will not be shared.
+
+The 'failureCallback' function takes one parameter, an error object. The only property defined on this object is an optional `stack` property of type `string`.
+
+The 'successCallback' function takes two parameters:
+
+- a boolean value signifying success or failure
+- a string that, in the case of success, indicates the method of sharing
diff --git a/website/versioned_docs/version-0.70/activityindicator.md b/website/versioned_docs/version-0.70/activityindicator.md
new file mode 100644
index 00000000000..33e05f8d587
--- /dev/null
+++ b/website/versioned_docs/version-0.70/activityindicator.md
@@ -0,0 +1,127 @@
+---
+id: activityindicator
+title: ActivityIndicator
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+Displays a circular loading indicator.
+
+## Example
+
+
+
+
+```SnackPlayer name=ActivityIndicator%20Function%20Component%20Example
+import React from "react";
+import { ActivityIndicator, StyleSheet, Text, View } from "react-native";
+
+const App = () => (
+
+
+
+
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center"
+ },
+ horizontal: {
+ flexDirection: "row",
+ justifyContent: "space-around",
+ padding: 10
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=ActivityIndicator%20Class%20Component%20Example
+import React, { Component } from "react";
+import { ActivityIndicator, StyleSheet, Text, View } from "react-native";
+
+class App extends Component {
+ render() {
+ return (
+
+
+
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center"
+ },
+ horizontal: {
+ flexDirection: "row",
+ justifyContent: "space-around",
+ padding: 10
+ }
+});
+
+export default App;
+```
+
+
+
+
+# Reference
+
+## Props
+
+### [View Props](view#props)
+
+Inherits [View Props](view#props).
+
+---
+
+### `animating`
+
+Whether to show the indicator (`true`) or hide it (`false`).
+
+| Type | Default |
+| ---- | ------- |
+| bool | `true` |
+
+---
+
+### `color`
+
+The foreground color of the spinner.
+
+| Type | Default |
+| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [color](colors) | `null` (system accent default color)
Android
`'#999999'`
iOS
|
+
+---
+
+### `hidesWhenStopped`
iOS
+
+Whether the indicator should hide when not animating.
+
+| Type | Default |
+| ---- | ------- |
+| bool | `true` |
+
+---
+
+### `size`
+
+Size of the indicator.
+
+| Type | Default |
+| ------------------------------------------------------------------------------ | --------- |
+| enum(`'small'`, `'large'`)number
Android
| `'small'` |
diff --git a/website/versioned_docs/version-0.70/alert.md b/website/versioned_docs/version-0.70/alert.md
new file mode 100644
index 00000000000..cd332863c3b
--- /dev/null
+++ b/website/versioned_docs/version-0.70/alert.md
@@ -0,0 +1,316 @@
+---
+id: alert
+title: Alert
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+Launches an alert dialog with the specified title and message.
+
+Optionally provide a list of buttons. Tapping any button will fire the respective onPress callback and dismiss the alert. By default, the only button will be an 'OK' button.
+
+This is an API that works both on Android and iOS and can show static alerts. Alert that prompts the user to enter some information is available on iOS only.
+
+## Example
+
+
+
+
+```SnackPlayer name=Alert%20Function%20Component%20Example&supportedPlatforms=ios,android
+import React, { useState } from "react";
+import { View, StyleSheet, Button, Alert } from "react-native";
+
+const App = () => {
+ const createTwoButtonAlert = () =>
+ Alert.alert(
+ "Alert Title",
+ "My Alert Msg",
+ [
+ {
+ text: "Cancel",
+ onPress: () => console.log("Cancel Pressed"),
+ style: "cancel"
+ },
+ { text: "OK", onPress: () => console.log("OK Pressed") }
+ ]
+ );
+
+ const createThreeButtonAlert = () =>
+ Alert.alert(
+ "Alert Title",
+ "My Alert Msg",
+ [
+ {
+ text: "Ask me later",
+ onPress: () => console.log("Ask me later pressed")
+ },
+ {
+ text: "Cancel",
+ onPress: () => console.log("Cancel Pressed"),
+ style: "cancel"
+ },
+ { text: "OK", onPress: () => console.log("OK Pressed") }
+ ]
+ );
+
+ return (
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "space-around",
+ alignItems: "center"
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=Alert%20Class%20Component%20Example&supportedPlatforms=ios,android
+import React, { Component } from "react";
+import { View, StyleSheet, Button, Alert } from "react-native";
+
+class App extends Component {
+ createTwoButtonAlert = () =>
+ Alert.alert(
+ "Alert Title",
+ "My Alert Msg",
+ [
+ {
+ text: "Cancel",
+ onPress: () => console.log("Cancel Pressed"),
+ style: "cancel"
+ },
+ { text: "OK", onPress: () => console.log("OK Pressed") }
+ ]
+ );
+
+ createThreeButtonAlert = () =>
+ Alert.alert(
+ "Alert Title",
+ "My Alert Msg",
+ [
+ {
+ text: "Ask me later",
+ onPress: () => console.log("Ask me later pressed")
+ },
+ {
+ text: "Cancel",
+ onPress: () => console.log("Cancel Pressed"),
+ style: "cancel"
+ },
+ { text: "OK", onPress: () => console.log("OK Pressed") }
+ ]
+ );
+
+ render() {
+ return (
+
+
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "space-around",
+ alignItems: "center"
+ }
+});
+
+export default App;
+```
+
+
+
+
+## iOS
+
+On iOS you can specify any number of buttons. Each button can optionally specify a style, available options are represented by the [AlertButtonStyle](#alertbuttonstyle-ios) enum.
+
+## Android
+
+On Android at most three buttons can be specified. Android has a concept of a neutral, negative and a positive button:
+
+- If you specify one button, it will be the 'positive' one (such as 'OK')
+- Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')
+- Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')
+
+Alerts on Android can be dismissed by tapping outside of the alert box. It is disabled by default and can be enabled by providing an optional [Options](alert#options) parameter with the cancelable property set to `true` i.e. `{ cancelable: true }`.
+
+The cancel event can be handled by providing an `onDismiss` callback property inside the `options` parameter.
+
+### Example
| string | The dialog's title. Passing `null` or empty string will hide the title. |
+| message | string | An optional message that appears below the dialog's title. |
+| buttons | [Buttons](alert#buttons) | An optional array containing buttons configuration. |
+| options | [Options](alert#options) | An optional Alert configuration. |
+
+---
+
+### `prompt()`
iOS
+
+```jsx
+static prompt(title, message?, callbackOrButtons?, type?, defaultValue?, keyboardType?)
+```
+
+Create and display a prompt to enter some text in form of Alert.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------------------------------------------------------ | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| title
Required
| string | The dialog's title. |
+| message | string | An optional message that appears above the text input. |
+| callbackOrButtons | function[Buttons](alert#buttons) | If passed a function, it will be called with the prompt's value `(text: string) => void`, when the user taps 'OK'.If passed an array, buttons will be configured based on the array content. |
+| type | [AlertType](alert#alerttype-ios) | This configures the text input. |
+| defaultValue | string | The default text in text input. |
+| keyboardType | string | The keyboard type of first text field (if exists). One of TextInput [keyboardTypes](textinput#keyboardtype). |
+| options | [Options](alert#options) | An optional Alert configuration. |
+
+---
+
+## Type Definitions
+
+### AlertButtonStyle
+
+An iOS Alert type.
+
+| Type |
+| ---- |
+| enum |
+
+**Constants:**
+
+| Value | Description |
+| ------------------ | ---------------------------- |
+| `'default'` | Default alert with no inputs |
+| `'plain-text'` | Plain text input alert |
+| `'secure-text'` | Secure text input alert |
+| `'login-password'` | Login and password alert |
+
+---
+
+### Buttons
+
+Array of objects containing Alert buttons configuration.
+
+| Type |
+| ---------------- |
+| array of objects |
+
+**Objects properties:**
+
+| Name | Type | Description |
+| -------------------------------------- | ---------------------------------------------- | ------------------------------------------------------- |
+| text | string | Button label. |
+| onPress | function | Callback function when button is pressed. |
+| style
iOS
| [AlertButtonStyle](alert#alertbuttonstyle-ios) | Button style, on Android this property will be ignored. |
+
+---
+
+### Options
+
+| Type |
+| ------ |
+| object |
+
+**Properties:**
+
+| Name | Type | Description |
+| --------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
+| cancelable
Android
| boolean | Defines if alert can be dismissed by tapping outside of the alert box. |
+| userInterfaceStyle
iOS
| string | The interface style used for the alert, can be set to `light` or `dark`, otherwise the default system style will be used. |
+| onDismiss
Android
| function | Callback function fired when alert has been dismissed. |
diff --git a/website/versioned_docs/version-0.70/alertios.md b/website/versioned_docs/version-0.70/alertios.md
new file mode 100644
index 00000000000..e338397bbd6
--- /dev/null
+++ b/website/versioned_docs/version-0.70/alertios.md
@@ -0,0 +1,190 @@
+---
+id: alertios
+title: '🚧 AlertIOS'
+---
+
+> **Deprecated.** Use [`Alert`](alert) instead.
+
+`AlertIOS` provides functionality to create an iOS alert dialog with a message or create a prompt for user input.
+
+Creating an iOS alert:
+
+```jsx
+AlertIOS.alert(
+ 'Sync Complete',
+ 'All your data are belong to us.'
+);
+```
+
+Creating an iOS prompt:
+
+```jsx
+AlertIOS.prompt('Enter a value', null, (text) =>
+ console.log('You entered ' + text)
+);
+```
+
+We recommend using the [`Alert.alert`](alert) method for cross-platform support if you don't need to create iOS-only prompts.
+
+---
+
+# Reference
+
+## Methods
+
+### `alert()`
+
+```jsx
+static alert(title: string, [message]: string, [callbackOrButtons]: ?(() => void), ButtonsArray, [type]: AlertType): [object Object]
+```
+
+Create and display a popup alert.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ----------------- | --------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| title | string | Yes | The dialog's title. Passing null or '' will hide the title. |
+| message | string | No | An optional message that appears below the dialog's title. |
+| callbackOrButtons | ?(() => void),[ButtonsArray](alertios#buttonsarray) | No | This optional argument should be either a single-argument function or an array of buttons. If passed a function, it will be called when the user taps 'OK'. If passed an array of button configurations, each button should include a `text` key, as well as optional `onPress` and `style` keys. `style` should be one of 'default', 'cancel' or 'destructive'. |
+| type | [AlertType](alertios#alerttype) | No | Deprecated, do not use. |
+
+Example with custom buttons:
+
+```jsx
+AlertIOS.alert(
+ 'Update available',
+ 'Keep your app up to date to enjoy the latest features',
+ [
+ {
+ text: 'Cancel',
+ onPress: () => console.log('Cancel Pressed'),
+ style: 'cancel'
+ },
+ {
+ text: 'Install',
+ onPress: () => console.log('Install Pressed')
+ }
+ ]
+);
+```
+
+---
+
+### `prompt()`
+
+```jsx
+static prompt(title: string, [message]: string, [callbackOrButtons]: ?((text: string) => void), ButtonsArray, [type]: AlertType, [defaultValue]: string, [keyboardType]: string): [object Object]
+```
+
+Create and display a prompt to enter some text.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ----------------- | --------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| title | string | Yes | The dialog's title. |
+| message | string | No | An optional message that appears above the text input. |
+| callbackOrButtons | ?((text: string) => void),[ButtonsArray](alertios#buttonsarray) | No | This optional argument should be either a single-argument function or an array of buttons. If passed a function, it will be called with the prompt's value when the user taps 'OK'. If passed an array of button configurations, each button should include a `text` key, as well as optional `onPress` and `style` keys (see example). `style` should be one of 'default', 'cancel' or 'destructive'. |
+| type | [AlertType](alertios#alerttype) | No | This configures the text input. One of 'plain-text', 'secure-text' or 'login-password'. |
+| defaultValue | string | No | The default text in text input. |
+| keyboardType | string | No | The keyboard type of first text field(if exists). One of 'default', 'email-address', 'numeric', 'phone-pad', 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad', 'name-phone-pad', 'decimal-pad', 'twitter' or 'web-search'. |
+
+Example with custom buttons:
+
+```jsx
+AlertIOS.prompt(
+ 'Enter password',
+ 'Enter your password to claim your $1.5B in lottery winnings',
+ [
+ {
+ text: 'Cancel',
+ onPress: () => console.log('Cancel Pressed'),
+ style: 'cancel'
+ },
+ {
+ text: 'OK',
+ onPress: (password) =>
+ console.log('OK Pressed, password: ' + password)
+ }
+ ],
+ 'secure-text'
+);
+```
+
+,
+
+Example with the default button and a custom callback:
+
+```jsx
+AlertIOS.prompt(
+ 'Update username',
+ null,
+ (text) => console.log('Your username is ' + text),
+ null,
+ 'default'
+);
+```
+
+## Type Definitions
+
+### AlertType
+
+An Alert button type
+
+| Type |
+| ------ |
+| \$Enum |
+
+**Constants:**
+
+| Value | Description |
+| -------------- | ---------------------------- |
+| default | Default alert with no inputs |
+| plain-text | Plain text input alert |
+| secure-text | Secure text input alert |
+| login-password | Login and password alert |
+
+---
+
+### AlertButtonStyle
+
+An Alert button style
+
+| Type |
+| ------ |
+| \$Enum |
+
+**Constants:**
+
+| Value | Description |
+| ----------- | ------------------------ |
+| default | Default button style |
+| cancel | Cancel button style |
+| destructive | Destructive button style |
+
+---
+
+### ButtonsArray
+
+Array or buttons
+
+| Type |
+| ----- |
+| Array |
+
+**Properties:**
+
+| Name | Type | Description |
+| --------- | --------------------------------------------- | ------------------------------------- |
+| [text] | string | Button label |
+| [onPress] | function | Callback function when button pressed |
+| [style] | [AlertButtonStyle](alertios#alertbuttonstyle) | Button style |
+
+**Constants:**
+
+| Value | Description |
+| ------- | ------------------------------------- |
+| text | Button label |
+| onPress | Callback function when button pressed |
+| style | Button style |
diff --git a/website/versioned_docs/version-0.70/animated.md b/website/versioned_docs/version-0.70/animated.md
new file mode 100644
index 00000000000..0e278ac247c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/animated.md
@@ -0,0 +1,603 @@
+---
+id: animated
+title: Animated
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+The `Animated` library is designed to make animations fluid, powerful, and painless to build and maintain. `Animated` focuses on declarative relationships between inputs and outputs, configurable transforms in between, and `start`/`stop` methods to control time-based animation execution.
+
+The core workflow for creating an animation is to create an `Animated.Value`, hook it up to one or more style attributes of an animated component, and then drive updates via animations using `Animated.timing()`.
+
+
+
+
+> Don't modify the animated value directly. You can use the [`useRef` Hook](https://reactjs.org/docs/hooks-reference.html#useref) to return a mutable ref object. This ref object's `current` property is initialized as the given argument and persists throughout the component lifecycle.
+
+
+
+
+> Don't modify the animated value directly. It is usually stored as a [state variable](intro-react#state) in class components.
+
+
+
+
+## Example
+
+The following example contains a `View` which will fade in and fade out based on the animated value `fadeAnim`
+
+
+
+
+```SnackPlayer name=Animated
+import React, { useRef } from "react";
+import { Animated, Text, View, StyleSheet, Button, SafeAreaView } from "react-native";
+
+const App = () => {
+ // fadeAnim will be used as the value for opacity. Initial Value: 0
+ const fadeAnim = useRef(new Animated.Value(0)).current;
+
+ const fadeIn = () => {
+ // Will change fadeAnim value to 1 in 5 seconds
+ Animated.timing(fadeAnim, {
+ toValue: 1,
+ duration: 5000
+ }).start();
+ };
+
+ const fadeOut = () => {
+ // Will change fadeAnim value to 0 in 3 seconds
+ Animated.timing(fadeAnim, {
+ toValue: 0,
+ duration: 3000
+ }).start();
+ };
+
+ return (
+
+
+ Fading View!
+
+
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ fadingContainer: {
+ padding: 20,
+ backgroundColor: "powderblue"
+ },
+ fadingText: {
+ fontSize: 28
+ },
+ buttonRow: {
+ flexBasis: 100,
+ justifyContent: "space-evenly",
+ marginVertical: 16
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=Animated
+import React, { Component } from "react";
+import { Animated, Text, View, StyleSheet, Button, SafeAreaView } from "react-native";
+
+class App extends Component {
+ // fadeAnim will be used as the value for opacity. Initial Value: 0
+ state = {
+ fadeAnim: new Animated.Value(0)
+ };
+
+ fadeIn = () => {
+ // Will change fadeAnim value to 1 in 5 seconds
+ Animated.timing(this.state.fadeAnim, {
+ toValue: 1,
+ duration: 5000
+ }).start();
+ };
+
+ fadeOut = () => {
+ // Will change fadeAnim value to 0 in 3 seconds
+ Animated.timing(this.state.fadeAnim, {
+ toValue: 0,
+ duration: 3000
+ }).start();
+ };
+
+ render() {
+ return (
+
+
+ Fading View!
+
+
+
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ fadingContainer: {
+ padding: 20,
+ backgroundColor: "powderblue"
+ },
+ fadingText: {
+ fontSize: 28
+ },
+ buttonRow: {
+ flexBasis: 100,
+ justifyContent: "space-evenly",
+ marginVertical: 16
+ }
+});
+
+export default App;
+```
+
+
+
+
+Refer to the [Animations](animations#animated-api) guide to see additional examples of `Animated` in action.
+
+## Overview
+
+There are two value types you can use with `Animated`:
+
+- [`Animated.Value()`](animated#value) for single values
+- [`Animated.ValueXY()`](animated#valuexy) for vectors
+
+`Animated.Value` can bind to style properties or other props, and can be interpolated as well. A single `Animated.Value` can drive any number of properties.
+
+### Configuring animations
+
+`Animated` provides three types of animation types. Each animation type provides a particular animation curve that controls how your values animate from their initial value to the final value:
+
+- [`Animated.decay()`](animated#decay) starts with an initial velocity and gradually slows to a stop.
+- [`Animated.spring()`](animated#spring) provides a basic spring physics model.
+- [`Animated.timing()`](animated#timing) animates a value over time using [easing functions](easing).
+
+In most cases, you will be using `timing()`. By default, it uses a symmetric easeInOut curve that conveys the gradual acceleration of an object to full speed and concludes by gradually decelerating to a stop.
+
+### Working with animations
+
+Animations are started by calling `start()` on your animation. `start()` takes a completion callback that will be called when the animation is done. If the animation finished running normally, the completion callback will be invoked with `{finished: true}`. If the animation is done because `stop()` was called on it before it could finish (e.g. because it was interrupted by a gesture or another animation), then it will receive `{finished: false}`.
+
+```jsx
+Animated.timing({}).start(({ finished }) => {
+ /* completion callback */
+});
+```
+
+### Using the native driver
+
+By using the native driver, we send everything about the animation to native before starting the animation, allowing native code to perform the animation on the UI thread without having to go through the bridge on every frame. Once the animation has started, the JS thread can be blocked without affecting the animation.
+
+You can use the native driver by specifying `useNativeDriver: true` in your animation configuration. See the [Animations](animations#using-the-native-driver) guide to learn more.
+
+### Animatable components
+
+Only animatable components can be animated. These unique components do the magic of binding the animated values to the properties, and do targeted native updates to avoid the cost of the React render and reconciliation process on every frame. They also handle cleanup on unmount so they are safe by default.
+
+- [`createAnimatedComponent()`](animated#createanimatedcomponent) can be used to make a component animatable.
+
+`Animated` exports the following animatable components using the above wrapper:
+
+- `Animated.Image`
+- `Animated.ScrollView`
+- `Animated.Text`
+- `Animated.View`
+- `Animated.FlatList`
+- `Animated.SectionList`
+
+### Composing animations
+
+Animations can also be combined in complex ways using composition functions:
+
+- [`Animated.delay()`](animated#delay) starts an animation after a given delay.
+- [`Animated.parallel()`](animated#parallel) starts a number of animations at the same time.
+- [`Animated.sequence()`](animated#sequence) starts the animations in order, waiting for each to complete before starting the next.
+- [`Animated.stagger()`](animated#stagger) starts animations in order and in parallel, but with successive delays.
+
+Animations can also be chained together by setting the `toValue` of one animation to be another `Animated.Value`. See [Tracking dynamic values](animations#tracking-dynamic-values) in the Animations guide.
+
+By default, if one animation is stopped or interrupted, then all other animations in the group are also stopped.
+
+### Combining animated values
+
+You can combine two animated values via addition, subtraction, multiplication, division, or modulo to make a new animated value:
+
+- [`Animated.add()`](animated#add)
+- [`Animated.subtract()`](animated#subtract)
+- [`Animated.divide()`](animated#divide)
+- [`Animated.modulo()`](animated#modulo)
+- [`Animated.multiply()`](animated#multiply)
+
+### Interpolation
+
+The `interpolate()` function allows input ranges to map to different output ranges. By default, it will extrapolate the curve beyond the ranges given, but you can also have it clamp the output value. It uses linear interpolation by default but also supports easing functions.
+
+- [`interpolate()`](animated#interpolate)
+
+Read more about interpolation in the [Animation](animations#interpolation) guide.
+
+### Handling gestures and other events
+
+Gestures, like panning or scrolling, and other events can map directly to animated values using `Animated.event()`. This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
+
+- [`Animated.event()`](animated#event)
+
+For example, when working with horizontal scrolling gestures, you would do the following in order to map `event.nativeEvent.contentOffset.x` to `scrollX` (an `Animated.Value`):
+
+```jsx
+ onScroll={Animated.event(
+ // scrollX = e.nativeEvent.contentOffset.x
+ [{ nativeEvent: {
+ contentOffset: {
+ x: scrollX
+ }
+ }
+ }]
+ )}
+```
+
+---
+
+# Reference
+
+## Methods
+
+When the given value is a ValueXY instead of a Value, each config option may be a vector of the form `{x: ..., y: ...}` instead of a scalar.
+
+### `decay()`
+
+```jsx
+static decay(value, config)
+```
+
+Animates a value from an initial velocity to zero based on a decay coefficient.
+
+Config is an object that may have the following options:
+
+- `velocity`: Initial velocity. Required.
+- `deceleration`: Rate of decay. Default 0.997.
+- `isInteraction`: Whether or not this animation creates an "interaction handle" on the `InteractionManager`. Default true.
+- `useNativeDriver`: Uses the native driver when true. Default false.
+
+---
+
+### `timing()`
+
+```jsx
+static timing(value, config)
+```
+
+Animates a value along a timed easing curve. The [`Easing`](easing) module has tons of predefined curves, or you can use your own function.
+
+Config is an object that may have the following options:
+
+- `duration`: Length of animation (milliseconds). Default 500.
+- `easing`: Easing function to define curve. Default is `Easing.inOut(Easing.ease)`.
+- `delay`: Start the animation after delay (milliseconds). Default 0.
+- `isInteraction`: Whether or not this animation creates an "interaction handle" on the `InteractionManager`. Default true.
+- `useNativeDriver`: Uses the native driver when true. Default false.
+
+---
+
+### `spring()`
+
+```jsx
+static spring(value, config)
+```
+
+Animates a value according to an analytical spring model based on [damped harmonic oscillation](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator). Tracks velocity state to create fluid motions as the `toValue` updates, and can be chained together.
+
+Config is an object that may have the following options.
+
+Note that you can only define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one:
+
+The friction/tension or bounciness/speed options match the spring model in [`Facebook Pop`](https://github.com/facebook/pop), [Rebound](https://github.com/facebookarchive/rebound), and [Origami](http://origami.design/).
+
+- `friction`: Controls "bounciness"/overshoot. Default 7.
+- `tension`: Controls speed. Default 40.
+- `speed`: Controls speed of the animation. Default 12.
+- `bounciness`: Controls bounciness. Default 8.
+
+Specifying stiffness/damping/mass as parameters makes `Animated.spring` use an analytical spring model based on the motion equations of a [damped harmonic oscillator](https://en.wikipedia.org/wiki/Harmonic_oscillator#Damped_harmonic_oscillator). This behavior is slightly more precise and faithful to the physics behind spring dynamics, and closely mimics the implementation in iOS's CASpringAnimation.
+
+- `stiffness`: The spring stiffness coefficient. Default 100.
+- `damping`: Defines how the spring’s motion should be damped due to the forces of friction. Default 10.
+- `mass`: The mass of the object attached to the end of the spring. Default 1.
+
+Other configuration options are as follows:
+
+- `velocity`: The initial velocity of the object attached to the spring. Default 0 (object is at rest).
+- `overshootClamping`: Boolean indicating whether the spring should be clamped and not bounce. Default false.
+- `restDisplacementThreshold`: The threshold of displacement from rest below which the spring should be considered at rest. Default 0.001.
+- `restSpeedThreshold`: The speed at which the spring should be considered at rest in pixels per second. Default 0.001.
+- `delay`: Start the animation after delay (milliseconds). Default 0.
+- `isInteraction`: Whether or not this animation creates an "interaction handle" on the `InteractionManager`. Default true.
+- `useNativeDriver`: Uses the native driver when true. Default false.
+
+---
+
+### `add()`
+
+```jsx
+static add(a, b)
+```
+
+Creates a new Animated value composed from two Animated values added together.
+
+---
+
+### `subtract()`
+
+```jsx
+static subtract(a, b)
+```
+
+Creates a new Animated value composed by subtracting the second Animated value from the first Animated value.
+
+---
+
+### `divide()`
+
+```jsx
+static divide(a, b)
+```
+
+Creates a new Animated value composed by dividing the first Animated value by the second Animated value.
+
+---
+
+### `multiply()`
+
+```jsx
+static multiply(a, b)
+```
+
+Creates a new Animated value composed from two Animated values multiplied together.
+
+---
+
+### `modulo()`
+
+```jsx
+static modulo(a, modulus)
+```
+
+Creates a new Animated value that is the (non-negative) modulo of the provided Animated value
+
+---
+
+### `diffClamp()`
+
+```jsx
+static diffClamp(a, min, max)
+```
+
+Create a new Animated value that is limited between 2 values. It uses the difference between the last value so even if the value is far from the bounds it will start changing when the value starts getting closer again. (`value = clamp(value + diff, min, max)`).
+
+This is useful with scroll events, for example, to show the navbar when scrolling up and to hide it when scrolling down.
+
+---
+
+### `delay()`
+
+```jsx
+static delay(time)
+```
+
+Starts an animation after the given delay.
+
+---
+
+### `sequence()`
+
+```jsx
+static sequence(animations)
+```
+
+Starts an array of animations in order, waiting for each to complete before starting the next. If the current running animation is stopped, no following animations will be started.
+
+---
+
+### `parallel()`
+
+```jsx
+static parallel(animations, config?)
+```
+
+Starts an array of animations all at the same time. By default, if one of the animations is stopped, they will all be stopped. You can override this with the `stopTogether` flag.
+
+---
+
+### `stagger()`
+
+```jsx
+static stagger(time, animations)
+```
+
+Array of animations may run in parallel (overlap), but are started in sequence with successive delays. Nice for doing trailing effects.
+
+---
+
+### `loop()`
+
+```jsx
+static loop(animation, config?)
+```
+
+Loops a given animation continuously, so that each time it reaches the end, it resets and begins again from the start. Will loop without blocking the JS thread if the child animation is set to `useNativeDriver: true`. In addition, loops can prevent `VirtualizedList`-based components from rendering more rows while the animation is running. You can pass `isInteraction: false` in the child animation config to fix this.
+
+Config is an object that may have the following options:
+
+- `iterations`: Number of times the animation should loop. Default `-1` (infinite).
+
+---
+
+### `event()`
+
+```jsx
+static event(argMapping, config?)
+```
+
+Takes an array of mappings and extracts values from each arg accordingly, then calls `setValue` on the mapped outputs. e.g.
+
+```jsx
+ onScroll={Animated.event(
+ [{nativeEvent: {contentOffset: {x: this._scrollX}}}],
+ {listener: (event) => console.log(event)}, // Optional async listener
+ )}
+ ...
+ onPanResponderMove: Animated.event([
+ null, // raw event arg ignored
+ {dx: this._panX}], // gestureState arg
+{listener: (event, gestureState) => console.log(event, gestureState)}, // Optional async listener
+ ),
+```
+
+Config is an object that may have the following options:
+
+- `listener`: Optional async listener.
+- `useNativeDriver`: Uses the native driver when true. Default false.
+
+---
+
+### `forkEvent()`
+
+```jsx
+static forkEvent(event, listener)
+```
+
+Advanced imperative API for snooping on animated events that are passed in through props. It permits to add a new javascript listener to an existing `AnimatedEvent`. If `animatedEvent` is a javascript listener, it will merge the 2 listeners into a single one, and if `animatedEvent` is null/undefined, it will assign the javascript listener directly. Use values directly where possible.
+
+---
+
+### `unforkEvent()`
+
+```jsx
+static unforkEvent(event, listener)
+```
+
+---
+
+### `start()`
+
+```jsx
+static start([callback]: ?(result?: {finished: boolean}) => void)
+```
+
+Animations are started by calling start() on your animation. start() takes a completion callback that will be called when the animation is done or when the animation is done because stop() was called on it before it could finish.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | ------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| callback | ?(result?: {finished: boolean}) | No | Function that will be called after the animation finished running normally or when the animation is done because stop() was called on it before it could finish |
+
+Start example with callback:
+
+```jsx
+Animated.timing({}).start(({ finished }) => {
+ /* completion callback */
+});
+```
+
+---
+
+### `stop()`
+
+```jsx
+static stop()
+```
+
+Stops any running animation.
+
+---
+
+### `reset()`
+
+```jsx
+static reset()
+```
+
+Stops any running animation and resets the value to its original.
+
+## Properties
+
+### `Value`
+
+Standard value class for driving animations. Typically initialized with `new Animated.Value(0);`
+
+You can read more about `Animated.Value` API on the separate [page](animatedvalue).
+
+---
+
+### `ValueXY`
+
+2D value class for driving 2D animations, such as pan gestures.
+
+You can read more about `Animated.ValueXY` API on the separate [page](animatedvaluexy).
+
+---
+
+### `Interpolation`
+
+Exported to use the Interpolation type in flow.
+
+---
+
+### `Node`
+
+Exported for ease of type checking. All animated values derive from this class.
+
+---
+
+### `createAnimatedComponent`
+
+Make any React component Animatable. Used to create `Animated.View`, etc.
+
+---
+
+### `attachNativeEvent`
+
+Imperative API to attach an animated value to an event on a view. Prefer using `Animated.event` with `useNativeDrive: true` if possible.
diff --git a/website/versioned_docs/version-0.70/animatedvalue.md b/website/versioned_docs/version-0.70/animatedvalue.md
new file mode 100644
index 00000000000..36b782c777c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/animatedvalue.md
@@ -0,0 +1,210 @@
+---
+id: animatedvalue
+title: Animated.Value
+---
+
+Standard value for driving animations. One `Animated.Value` can drive multiple properties in a synchronized fashion, but can only be driven by one mechanism at a time. Using a new mechanism (e.g. starting a new animation, or calling `setValue`) will stop any previous ones.
+
+Typically initialized with `new Animated.Value(0);`
+
+---
+
+# Reference
+
+## Methods
+
+### `setValue()`
+
+```jsx
+setValue(value);
+```
+
+Directly set the value. This will stop any animations running on the value and update all the bound properties.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ----- | ------ | -------- | ----------- |
+| value | number | Yes | Value |
+
+---
+
+### `setOffset()`
+
+```jsx
+setOffset(offset);
+```
+
+Sets an offset that is applied on top of whatever value is set, whether via `setValue`, an animation, or `Animated.event`. Useful for compensating things like the start of a pan gesture.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ------ | ------ | -------- | ------------ |
+| offset | number | Yes | Offset value |
+
+---
+
+### `flattenOffset()`
+
+```jsx
+flattenOffset();
+```
+
+Merges the offset value into the base value and resets the offset to zero. The final output of the value is unchanged.
+
+---
+
+### `extractOffset()`
+
+```jsx
+extractOffset();
+```
+
+Sets the offset value to the base value, and resets the base value to zero. The final output of the value is unchanged.
+
+---
+
+### `addListener()`
+
+```jsx
+addListener(callback);
+```
+
+Adds an asynchronous listener to the value so you can observe updates from animations. This is useful because there is no way to synchronously read the value because it might be driven natively.
+
+Returns a string that serves as an identifier for the listener.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------- | -------- | ------------------------------------------------------------------------------------------- |
+| callback | function | Yes | The callback function which will receive an object with a `value` key set to the new value. |
+
+---
+
+### `removeListener()`
+
+```jsx
+removeListener(id);
+```
+
+Unregister a listener. The `id` param shall match the identifier previously returned by `addListener()`.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ---- | ------ | -------- | ---------------------------------- |
+| id | string | Yes | Id for the listener being removed. |
+
+---
+
+### `removeAllListeners()`
+
+```jsx
+removeAllListeners();
+```
+
+Remove all registered listeners.
+
+---
+
+### `stopAnimation()`
+
+```jsx
+stopAnimation([callback]);
+```
+
+Stops any running animation or tracking. `callback` is invoked with the final value after stopping the animation, which is useful for updating state to match the animation position with layout.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------- | -------- | --------------------------------------------- |
+| callback | function | No | A function that will receive the final value. |
+
+---
+
+### `resetAnimation()`
+
+```jsx
+resetAnimation([callback]);
+```
+
+Stops any animation and resets the value to its original.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------- | -------- | ------------------------------------------------ |
+| callback | function | No | A function that will receive the original value. |
+
+---
+
+### `interpolate()`
+
+```jsx
+interpolate(config);
+```
+
+Interpolates the value before updating the property, e.g. mapping 0-1 to 0-10.
+
+See `AnimatedInterpolation.js`
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ------ | ------ | -------- | ----------- |
+| config | object | Yes | See below. |
+
+The `config` object is composed of the following keys:
+
+- `inputRange`: an array of numbers
+- `outputRange`: an array of numbers or strings
+- `easing` (optional): a function that returns a number, given an input number
+- `extrapolate` (optional): a string such as 'extend', 'identity', or 'clamp'
+- `extrapolateLeft` (optional): a string such as 'extend', 'identity', or 'clamp'
+- `extrapolateRight` (optional): a string such as 'extend', 'identity', or 'clamp'
+
+---
+
+### `animate()`
+
+```jsx
+animate(animation, callback);
+```
+
+Typically only used internally, but could be used by a custom Animation class.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| --------- | --------- | -------- | ------------------- |
+| animation | Animation | Yes | See `Animation.js`. |
+| callback | function | Yes | Callback function. |
+
+---
+
+### `stopTracking()`
+
+```jsx
+stopTracking();
+```
+
+Typically only used internally.
+
+---
+
+### `track()`
+
+```jsx
+track(tracking);
+```
+
+Typically only used internally.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | ------------ | -------- | --------------------- |
+| tracking | AnimatedNode | Yes | See `AnimatedNode.js` |
diff --git a/website/versioned_docs/version-0.70/animatedvaluexy.md b/website/versioned_docs/version-0.70/animatedvaluexy.md
new file mode 100644
index 00000000000..cfe73bc5a59
--- /dev/null
+++ b/website/versioned_docs/version-0.70/animatedvaluexy.md
@@ -0,0 +1,221 @@
+---
+id: animatedvaluexy
+title: Animated.ValueXY
+---
+
+2D Value for driving 2D animations, such as pan gestures. Almost identical API to normal [`Animated.Value`](animatedvalue), but multiplexed. Contains two regular `Animated.Value`s under the hood.
+
+## Example
+
+```SnackPlayer name=Animated.ValueXY
+import React, { useRef } from "react";
+import { Animated, PanResponder, StyleSheet, View } from "react-native";
+
+const DraggableView = () => {
+ const pan = useRef(new Animated.ValueXY()).current;
+
+ const panResponder = PanResponder.create({
+ onStartShouldSetPanResponder: () => true,
+ onPanResponderMove: Animated.event([
+ null,
+ {
+ dx: pan.x, // x,y are Animated.Value
+ dy: pan.y,
+ },
+ ]),
+ onPanResponderRelease: () => {
+ Animated.spring(
+ pan, // Auto-multiplexed
+ { toValue: { x: 0, y: 0 } } // Back to zero
+ ).start();
+ },
+ });
+
+ return (
+
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center",
+ },
+ box: {
+ backgroundColor: "#61dafb",
+ width: 80,
+ height: 80,
+ borderRadius: 4,
+ },
+});
+
+export default DraggableView;
+```
+
+---
+
+# Reference
+
+## Methods
+
+### `setValue()`
+
+```jsx
+setValue(value);
+```
+
+Directly set the value. This will stop any animations running on the value and update all the bound properties.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ----- | ------ | -------- | ----------- |
+| value | number | Yes | Value |
+
+---
+
+### `setOffset()`
+
+```jsx
+setOffset(offset);
+```
+
+Sets an offset that is applied on top of whatever value is set, whether via `setValue`, an animation, or `Animated.event`. Useful for compensating things like the start of a pan gesture.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ------ | ------ | -------- | ------------ |
+| offset | number | Yes | Offset value |
+
+---
+
+### `flattenOffset()`
+
+```jsx
+flattenOffset();
+```
+
+Merges the offset value into the base value and resets the offset to zero. The final output of the value is unchanged.
+
+---
+
+### `extractOffset()`
+
+```jsx
+extractOffset();
+```
+
+Sets the offset value to the base value, and resets the base value to zero. The final output of the value is unchanged.
+
+---
+
+### `addListener()`
+
+```jsx
+addListener(callback);
+```
+
+Adds an asynchronous listener to the value so you can observe updates from animations. This is useful because there is no way to synchronously read the value because it might be driven natively.
+
+Returns a string that serves as an identifier for the listener.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------- | -------- | ------------------------------------------------------------------------------------------- |
+| callback | function | Yes | The callback function which will receive an object with a `value` key set to the new value. |
+
+---
+
+### `removeListener()`
+
+```jsx
+removeListener(id);
+```
+
+Unregister a listener. The `id` param shall match the identifier previously returned by `addListener()`.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ---- | ------ | -------- | ---------------------------------- |
+| id | string | Yes | Id for the listener being removed. |
+
+---
+
+### `removeAllListeners()`
+
+```jsx
+removeAllListeners();
+```
+
+Remove all registered listeners.
+
+---
+
+### `stopAnimation()`
+
+```jsx
+stopAnimation([callback]);
+```
+
+Stops any running animation or tracking. `callback` is invoked with the final value after stopping the animation, which is useful for updating state to match the animation position with layout.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------- | -------- | --------------------------------------------- |
+| callback | function | No | A function that will receive the final value. |
+
+---
+
+### `resetAnimation()`
+
+```jsx
+resetAnimation([callback]);
+```
+
+Stops any animation and resets the value to its original.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------- | -------- | ------------------------------------------------ |
+| callback | function | No | A function that will receive the original value. |
+
+---
+
+### `getLayout()`
+
+```jsx
+getLayout();
+```
+
+Converts `{x, y}` into `{left, top}` for use in style, e.g.
+
+```jsx
+style={this.state.anim.getLayout()}
+```
+
+---
+
+### `getTranslateTransform()`
+
+```jsx
+getTranslateTransform();
+```
+
+Converts `{x, y}` into a useable translation transform, e.g.
+
+```jsx
+style={{
+ transform: this.state.anim.getTranslateTransform()
+}}
+```
diff --git a/website/versioned_docs/version-0.70/animations.md b/website/versioned_docs/version-0.70/animations.md
new file mode 100644
index 00000000000..18704441310
--- /dev/null
+++ b/website/versioned_docs/version-0.70/animations.md
@@ -0,0 +1,821 @@
+---
+id: animations
+title: Animations
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+Animations are very important to create a great user experience. Stationary objects must overcome inertia as they start moving. Objects in motion have momentum and rarely come to a stop immediately. Animations allow you to convey physically believable motion in your interface.
+
+React Native provides two complementary animation systems: [`Animated`](animations#animated-api) for granular and interactive control of specific values, and [`LayoutAnimation`](animations#layoutanimation-api) for animated global layout transactions.
+
+## `Animated` API
+
+The [`Animated`](animated) API is designed to concisely express a wide variety of interesting animation and interaction patterns in a very performant way. `Animated` focuses on declarative relationships between inputs and outputs, with configurable transforms in between, and `start`/`stop` methods to control time-based animation execution.
+
+`Animated` exports six animatable component types: `View`, `Text`, `Image`, `ScrollView`, `FlatList` and `SectionList`, but you can also create your own using `Animated.createAnimatedComponent()`.
+
+For example, a container view that fades in when it is mounted may look like this:
+
+```SnackPlayer
+import React, { useRef, useEffect } from 'react';
+import { Animated, Text, View } from 'react-native';
+
+const FadeInView = (props) => {
+ const fadeAnim = useRef(new Animated.Value(0)).current // Initial value for opacity: 0
+
+ useEffect(() => {
+ Animated.timing(
+ fadeAnim,
+ {
+ toValue: 1,
+ duration: 10000,
+ }
+ ).start();
+ }, [fadeAnim])
+
+ return (
+
+ {props.children}
+
+ );
+}
+
+// You can then use your `FadeInView` in place of a `View` in your components:
+export default () => {
+ return (
+
+
+ Fading in
+
+
+ )
+}
+```
+
+Let's break down what's happening here. In the `FadeInView` constructor, a new `Animated.Value` called `fadeAnim` is initialized as part of `state`. The opacity property on the `View` is mapped to this animated value. Behind the scenes, the numeric value is extracted and used to set opacity.
+
+When the component mounts, the opacity is set to 0. Then, an easing animation is started on the `fadeAnim` animated value, which will update all of its dependent mappings (in this case, only the opacity) on each frame as the value animates to the final value of 1.
+
+This is done in an optimized way that is faster than calling `setState` and re-rendering. Because the entire configuration is declarative, we will be able to implement further optimizations that serialize the configuration and runs the animation on a high-priority thread.
+
+### Configuring animations
+
+Animations are heavily configurable. Custom and predefined easing functions, delays, durations, decay factors, spring constants, and more can all be tweaked depending on the type of animation.
+
+`Animated` provides several animation types, the most commonly used one being [`Animated.timing()`](animated#timing). It supports animating a value over time using one of various predefined easing functions, or you can use your own. Easing functions are typically used in animation to convey gradual acceleration and deceleration of objects.
+
+By default, `timing` will use an easeInOut curve that conveys gradual acceleration to full speed and concludes by gradually decelerating to a stop. You can specify a different easing function by passing an `easing` parameter. Custom `duration` or even a `delay` before the animation starts is also supported.
+
+For example, if we want to create a 2-second long animation of an object that slightly backs up before moving to its final position:
+
+```jsx
+Animated.timing(this.state.xPosition, {
+ toValue: 100,
+ easing: Easing.back(),
+ duration: 2000
+}).start();
+```
+
+Take a look at the [Configuring animations](animated#configuring-animations) section of the `Animated` API reference to learn more about all the config parameters supported by the built-in animations.
+
+### Composing animations
+
+Animations can be combined and played in sequence or in parallel. Sequential animations can play immediately after the previous animation has finished, or they can start after a specified delay. The `Animated` API provides several methods, such as `sequence()` and `delay()`, each of which take an array of animations to execute and automatically calls `start()`/`stop()` as needed.
+
+For example, the following animation coasts to a stop, then it springs back while twirling in parallel:
+
+```jsx
+Animated.sequence([
+ // decay, then spring to start and twirl
+ Animated.decay(position, {
+ // coast to a stop
+ velocity: { x: gestureState.vx, y: gestureState.vy }, // velocity from gesture release
+ deceleration: 0.997
+ }),
+ Animated.parallel([
+ // after decay, in parallel:
+ Animated.spring(position, {
+ toValue: { x: 0, y: 0 } // return to start
+ }),
+ Animated.timing(twirl, {
+ // and twirl
+ toValue: 360
+ })
+ ])
+]).start(); // start the sequence group
+```
+
+If one animation is stopped or interrupted, then all other animations in the group are also stopped. `Animated.parallel` has a `stopTogether` option that can be set to `false` to disable this.
+
+You can find a full list of composition methods in the [Composing animations](animated#composing-animations) section of the `Animated` API reference.
+
+### Combining animated values
+
+You can [combine two animated values](animated#combining-animated-values) via addition, multiplication, division, or modulo to make a new animated value.
+
+There are some cases where an animated value needs to invert another animated value for calculation. An example is inverting a scale (2x --> 0.5x):
+
+```jsx
+const a = new Animated.Value(1);
+const b = Animated.divide(1, a);
+
+Animated.spring(a, {
+ toValue: 2
+}).start();
+```
+
+### Interpolation
+
+Each property can be run through an interpolation first. An interpolation maps input ranges to output ranges, typically using a linear interpolation but also supports easing functions. By default, it will extrapolate the curve beyond the ranges given, but you can also have it clamp the output value.
+
+A basic mapping to convert a 0-1 range to a 0-100 range would be:
+
+```jsx
+value.interpolate({
+ inputRange: [0, 1],
+ outputRange: [0, 100]
+});
+```
+
+For example, you may want to think about your `Animated.Value` as going from 0 to 1, but animate the position from 150px to 0px and the opacity from 0 to 1. This can be done by modifying `style` from the example above like so:
+
+```jsx
+ style={{
+ opacity: this.state.fadeAnim, // Binds directly
+ transform: [{
+ translateY: this.state.fadeAnim.interpolate({
+ inputRange: [0, 1],
+ outputRange: [150, 0] // 0 : 150, 0.5 : 75, 1 : 0
+ }),
+ }],
+ }}
+```
+
+[`interpolate()`](animated#interpolate) supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get a negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:
+
+```jsx
+value.interpolate({
+ inputRange: [-300, -100, 0, 100, 101],
+ outputRange: [300, 0, 1, 0, 0]
+});
+```
+
+Which would map like so:
+
+```
+Input | Output
+------|-------
+ -400| 450
+ -300| 300
+ -200| 150
+ -100| 0
+ -50| 0.5
+ 0| 1
+ 50| 0.5
+ 100| 0
+ 101| 0
+ 200| 0
+```
+
+`interpolate()` also supports mapping to strings, allowing you to animate colors as well as values with units. For example, if you wanted to animate a rotation you could do:
+
+```jsx
+value.interpolate({
+ inputRange: [0, 360],
+ outputRange: ['0deg', '360deg']
+});
+```
+
+`interpolate()` also supports arbitrary easing functions, many of which are already implemented in the [`Easing`](easing) module. `interpolate()` also has configurable behavior for extrapolating the `outputRange`. You can set the extrapolation by setting the `extrapolate`, `extrapolateLeft`, or `extrapolateRight` options. The default value is `extend` but you can use `clamp` to prevent the output value from exceeding `outputRange`.
+
+### Tracking dynamic values
+
+Animated values can also track other values by setting the `toValue` of an animation to another animated value instead of a plain number. For example, a "Chat Heads" animation like the one used by Messenger on Android could be implemented with a `spring()` pinned on another animated value, or with `timing()` and a `duration` of 0 for rigid tracking. They can also be composed with interpolations:
+
+```jsx
+Animated.spring(follower, { toValue: leader }).start();
+Animated.timing(opacity, {
+ toValue: pan.x.interpolate({
+ inputRange: [0, 300],
+ outputRange: [1, 0]
+ })
+}).start();
+```
+
+The `leader` and `follower` animated values would be implemented using `Animated.ValueXY()`. `ValueXY` is a handy way to deal with 2D interactions, such as panning or dragging. It is a basic wrapper that contains two `Animated.Value` instances and some helper functions that call through to them, making `ValueXY` a drop-in replacement for `Value` in many cases. It allows us to track both x and y values in the example above.
+
+### Tracking gestures
+
+Gestures, like panning or scrolling, and other events can map directly to animated values using [`Animated.event`](animated#event). This is done with a structured map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects.
+
+For example, when working with horizontal scrolling gestures, you would do the following in order to map `event.nativeEvent.contentOffset.x` to `scrollX` (an `Animated.Value`):
+
+```jsx
+ onScroll={Animated.event(
+ // scrollX = e.nativeEvent.contentOffset.x
+ [{ nativeEvent: {
+ contentOffset: {
+ x: scrollX
+ }
+ }
+ }]
+ )}
+```
+
+The following example implements a horizontal scrolling carousel where the scroll position indicators are animated using the `Animated.event` used in the `ScrollView`
+
+#### ScrollView with Animated Event Example
+
+
+
+
+```SnackPlayer name=Animated&supportedPlatforms=ios,android
+import React, { useRef } from "react";
+import {
+ SafeAreaView,
+ ScrollView,
+ Text,
+ StyleSheet,
+ View,
+ ImageBackground,
+ Animated,
+ useWindowDimensions
+} from "react-native";
+
+const images = new Array(6).fill('https://images.unsplash.com/photo-1556740749-887f6717d7e4');
+
+const App = () => {
+ const scrollX = useRef(new Animated.Value(0)).current;
+
+ const { width: windowWidth } = useWindowDimensions();
+
+ return (
+
+
+
+ {images.map((image, imageIndex) => {
+ return (
+
+
+
+
+ {"Image - " + imageIndex}
+
+
+
+
+ );
+ })}
+
+
+ {images.map((image, imageIndex) => {
+ const width = scrollX.interpolate({
+ inputRange: [
+ windowWidth * (imageIndex - 1),
+ windowWidth * imageIndex,
+ windowWidth * (imageIndex + 1)
+ ],
+ outputRange: [8, 16, 8],
+ extrapolate: "clamp"
+ });
+ return (
+
+ );
+ })}
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ scrollContainer: {
+ height: 300,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ card: {
+ flex: 1,
+ marginVertical: 4,
+ marginHorizontal: 16,
+ borderRadius: 5,
+ overflow: "hidden",
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ textContainer: {
+ backgroundColor: "rgba(0,0,0, 0.7)",
+ paddingHorizontal: 24,
+ paddingVertical: 8,
+ borderRadius: 5
+ },
+ infoText: {
+ color: "white",
+ fontSize: 16,
+ fontWeight: "bold"
+ },
+ normalDot: {
+ height: 8,
+ width: 8,
+ borderRadius: 4,
+ backgroundColor: "silver",
+ marginHorizontal: 4
+ },
+ indicatorContainer: {
+ flexDirection: "row",
+ alignItems: "center",
+ justifyContent: "center"
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=Animated&supportedPlatforms=ios,android
+import React, { Component } from "react";
+import {
+ SafeAreaView,
+ ScrollView,
+ Text,
+ StyleSheet,
+ View,
+ ImageBackground,
+ Animated,
+ Dimensions
+} from "react-native";
+
+const images = new Array(6).fill('https://images.unsplash.com/photo-1556740749-887f6717d7e4');
+
+const window = Dimensions.get("window");
+
+export default class App extends Component {
+ scrollX = new Animated.Value(0);
+
+ state = {
+ dimensions: {
+ window
+ }
+ };
+
+ onDimensionsChange = ({ window }) => {
+ this.setState({ dimensions: { window } });
+ };
+
+ componentDidMount() {
+ Dimensions.addEventListener("change", this.onDimensionsChange);
+ }
+
+ componentWillUnmount() {
+ Dimensions.removeEventListener("change", this.onDimensionsChange);
+ }
+
+ render() {
+ const windowWidth = this.state.dimensions.window.width;
+
+ return (
+
+
+
+ {images.map((image, imageIndex) => {
+ return (
+
+
+
+
+ {"Image - " + imageIndex}
+
+
+
+
+ );
+ })}
+
+
+ {images.map((image, imageIndex) => {
+ const width = this.scrollX.interpolate({
+ inputRange: [
+ windowWidth * (imageIndex - 1),
+ windowWidth * imageIndex,
+ windowWidth * (imageIndex + 1)
+ ],
+ outputRange: [8, 16, 8],
+ extrapolate: "clamp"
+ });
+ return (
+
+ );
+ })}
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ scrollContainer: {
+ height: 300,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ card: {
+ flex: 1,
+ marginVertical: 4,
+ marginHorizontal: 16,
+ borderRadius: 5,
+ overflow: "hidden",
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ textContainer: {
+ backgroundColor: "rgba(0,0,0, 0.7)",
+ paddingHorizontal: 24,
+ paddingVertical: 8,
+ borderRadius: 5
+ },
+ infoText: {
+ color: "white",
+ fontSize: 16,
+ fontWeight: "bold"
+ },
+ normalDot: {
+ height: 8,
+ width: 8,
+ borderRadius: 4,
+ backgroundColor: "silver",
+ marginHorizontal: 4
+ },
+ indicatorContainer: {
+ flexDirection: "row",
+ alignItems: "center",
+ justifyContent: "center"
+ }
+});
+```
+
+
+
+
+When using `PanResponder`, you could use the following code to extract the x and y positions from `gestureState.dx` and `gestureState.dy`. We use a `null` in the first position of the array, as we are only interested in the second argument passed to the `PanResponder` handler, which is the `gestureState`.
+
+```jsx
+onPanResponderMove={Animated.event(
+ [null, // ignore the native event
+ // extract dx and dy from gestureState
+ // like 'pan.x = gestureState.dx, pan.y = gestureState.dy'
+ {dx: pan.x, dy: pan.y}
+])}
+```
+
+#### PanResponder with Animated Event Example
+
+
+
+
+```SnackPlayer name=Animated
+import React, { useRef } from "react";
+import { Animated, View, StyleSheet, PanResponder, Text } from "react-native";
+
+const App = () => {
+ const pan = useRef(new Animated.ValueXY()).current;
+ const panResponder = useRef(
+ PanResponder.create({
+ onMoveShouldSetPanResponder: () => true,
+ onPanResponderMove: Animated.event([
+ null,
+ { dx: pan.x, dy: pan.y }
+ ]),
+ onPanResponderRelease: () => {
+ Animated.spring(pan, { toValue: { x: 0, y: 0 } }).start();
+ }
+ })
+ ).current;
+
+ return (
+
+ Drag & Release this box!
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ titleText: {
+ fontSize: 14,
+ lineHeight: 24,
+ fontWeight: "bold"
+ },
+ box: {
+ height: 150,
+ width: 150,
+ backgroundColor: "blue",
+ borderRadius: 5
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=Animated
+import React, { Component } from "react";
+import { Animated, View, StyleSheet, PanResponder, Text } from "react-native";
+
+export default class App extends Component {
+ pan = new Animated.ValueXY();
+ panResponder = PanResponder.create({
+ onMoveShouldSetPanResponder: () => true,
+ onPanResponderMove: Animated.event([
+ null,
+ { dx: this.pan.x, dy: this.pan.y }
+ ]),
+ onPanResponderRelease: () => {
+ Animated.spring(this.pan, { toValue: { x: 0, y: 0 } }).start();
+ }
+ });
+
+ render() {
+ return (
+
+ Drag & Release this box!
+
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ titleText: {
+ fontSize: 14,
+ lineHeight: 24,
+ fontWeight: "bold"
+ },
+ box: {
+ height: 150,
+ width: 150,
+ backgroundColor: "blue",
+ borderRadius: 5
+ }
+});
+```
+
+
+
+
+### Responding to the current animation value
+
+You may notice that there is no clear way to read the current value while animating. This is because the value may only be known in the native runtime due to optimizations. If you need to run JavaScript in response to the current value, there are two approaches:
+
+- `spring.stopAnimation(callback)` will stop the animation and invoke `callback` with the final value. This is useful when making gesture transitions.
+- `spring.addListener(callback)` will invoke `callback` asynchronously while the animation is running, providing a recent value. This is useful for triggering state changes, for example snapping a bobble to a new option as the user drags it closer, because these larger state changes are less sensitive to a few frames of lag compared to continuous gestures like panning which need to run at 60 fps.
+
+`Animated` is designed to be fully serializable so that animations can be run in a high performance way, independent of the normal JavaScript event loop. This does influence the API, so keep that in mind when it seems a little trickier to do something compared to a fully synchronous system. Check out `Animated.Value.addListener` as a way to work around some of these limitations, but use it sparingly since it might have performance implications in the future.
+
+### Using the native driver
+
+The `Animated` API is designed to be serializable. By using the [native driver](/blog/2017/02/14/using-native-driver-for-animated), we send everything about the animation to native before starting the animation, allowing native code to perform the animation on the UI thread without having to go through the bridge on every frame. Once the animation has started, the JS thread can be blocked without affecting the animation.
+
+Using the native driver for normal animations is straightforward. You can add `useNativeDriver: true` to the animation config when starting it.
+
+```jsx
+Animated.timing(this.state.animatedValue, {
+ toValue: 1,
+ duration: 500,
+ useNativeDriver: true // <-- Add this
+}).start();
+```
+
+Animated values are only compatible with one driver so if you use native driver when starting an animation on a value, make sure every animation on that value also uses the native driver.
+
+The native driver also works with `Animated.event`. This is especially useful for animations that follow the scroll position as without the native driver, the animation will always run a frame behind the gesture due to the async nature of React Native.
+
+```jsx
+
+ {content}
+
+```
+
+You can see the native driver in action by running the [RNTester app](https://github.com/facebook/react-native/blob/master/packages/rn-tester/), then loading the Native Animated Example. You can also take a look at the [source code](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/NativeAnimation/NativeAnimationsExample.js) to learn how these examples were produced.
+
+#### Caveats
+
+Not everything you can do with `Animated` is currently supported by the native driver. The main limitation is that you can only animate non-layout properties: things like `transform` and `opacity` will work, but Flexbox and position properties will not. When using `Animated.event`, it will only work with direct events and not bubbling events. This means it does not work with `PanResponder` but does work with things like `ScrollView#onScroll`.
+
+When an animation is running, it can prevent `VirtualizedList` components from rendering more rows. If you need to run a long or looping animation while the user is scrolling through a list, you can use `isInteraction: false` in your animation's config to prevent this issue.
+
+### Bear in mind
+
+While using transform styles such as `rotateY`, `rotateX`, and others ensure the transform style `perspective` is in place. At this time some animations may not render on Android without it. Example below.
+
+```jsx
+
+```
+
+### Additional examples
+
+The RNTester app has various examples of `Animated` in use:
+
+- [AnimatedGratuitousApp](https://github.com/facebook/react-native/tree/main/packages/rn-tester/js/examples/AnimatedGratuitousApp)
+- [NativeAnimationsExample](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/NativeAnimation/NativeAnimationsExample.js)
+
+## `LayoutAnimation` API
+
+`LayoutAnimation` allows you to globally configure `create` and `update` animations that will be used for all views in the next render/layout cycle. This is useful for doing Flexbox layout updates without bothering to measure or calculate specific properties in order to animate them directly, and is especially useful when layout changes may affect ancestors, for example a "see more" expansion that also increases the size of the parent and pushes down the row below which would otherwise require explicit coordination between the components in order to animate them all in sync.
+
+Note that although `LayoutAnimation` is very powerful and can be quite useful, it provides much less control than `Animated` and other animation libraries, so you may need to use another approach if you can't get `LayoutAnimation` to do what you want.
+
+Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:
+
+```jsx
+UIManager.setLayoutAnimationEnabledExperimental &&
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+```
+
+```SnackPlayer name=LayoutAnimations&supportedPlatforms=ios,android
+import React from 'react';
+import {
+ NativeModules,
+ LayoutAnimation,
+ Text,
+ TouchableOpacity,
+ StyleSheet,
+ View,
+} from 'react-native';
+
+const { UIManager } = NativeModules;
+
+UIManager.setLayoutAnimationEnabledExperimental &&
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+
+export default class App extends React.Component {
+ state = {
+ w: 100,
+ h: 100,
+ };
+
+ _onPress = () => {
+ // Animate the update
+ LayoutAnimation.spring();
+ this.setState({w: this.state.w + 15, h: this.state.h + 15})
+ }
+
+ render() {
+ return (
+
+
+
+
+ Press me!
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ box: {
+ width: 200,
+ height: 200,
+ backgroundColor: 'red',
+ },
+ button: {
+ backgroundColor: 'black',
+ paddingHorizontal: 20,
+ paddingVertical: 15,
+ marginTop: 15,
+ },
+ buttonText: {
+ color: '#fff',
+ fontWeight: 'bold',
+ },
+});
+```
+
+This example uses a preset value, you can customize the animations as you need, see [LayoutAnimation.js](https://github.com/facebook/react-native/blob/master/Libraries/LayoutAnimation/LayoutAnimation.js) for more information.
+
+## Additional notes
+
+### `requestAnimationFrame`
+
+`requestAnimationFrame` is a polyfill from the browser that you might be familiar with. It accepts a function as its only argument and calls that function before the next repaint. It is an essential building block for animations that underlies all of the JavaScript-based animation APIs. In general, you shouldn't need to call this yourself - the animation APIs will manage frame updates for you.
+
+### `setNativeProps`
+
+As mentioned [in the Direct Manipulation section](direct-manipulation), `setNativeProps` allows us to modify properties of native-backed components (components that are actually backed by native views, unlike composite components) directly, without having to `setState` and re-render the component hierarchy.
+
+We could use this in the Rebound example to update the scale - this might be helpful if the component that we are updating is deeply nested and hasn't been optimized with `shouldComponentUpdate`.
+
+If you find your animations with dropping frames (performing below 60 frames per second), look into using `setNativeProps` or `shouldComponentUpdate` to optimize them. Or you could run the animations on the UI thread rather than the JavaScript thread [with the useNativeDriver option](/blog/2017/02/14/using-native-driver-for-animated). You may also want to defer any computationally intensive work until after animations are complete, using the [InteractionManager](interactionmanager). You can monitor the frame rate by using the In-App Developer Menu "FPS Monitor" tool.
diff --git a/website/versioned_docs/version-0.70/app-extensions.md b/website/versioned_docs/version-0.70/app-extensions.md
new file mode 100644
index 00000000000..809cacfe1dd
--- /dev/null
+++ b/website/versioned_docs/version-0.70/app-extensions.md
@@ -0,0 +1,26 @@
+---
+id: app-extensions
+title: App Extensions
+---
+
+App extensions let you provide custom functionality and content outside of your main app. There are different types of app extensions on iOS, and they are all covered in the [App Extension Programming Guide](https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/index.html#//apple_ref/doc/uid/TP40014214-CH20-SW1). In this guide, we'll briefly cover how you may take advantage of app extensions on iOS.
+
+## Memory use in extensions
+
+As these extensions are loaded outside of the regular app sandbox, it's highly likely that several of these app extensions will be loaded simultaneously. As you might expect, these extensions have small memory usage limits. Keep these in mind when developing your app extensions. It's always highly recommended to test your application on an actual device, and more so when developing app extensions: too frequently, developers find that their extension works fine in the iOS Simulator, only to get user reports that their extension is not loading on actual devices.
+
+We highly recommend that you watch Conrad Kramer's talk on [Memory Use in Extensions](https://www.youtube.com/watch?v=GqXMqn6MXrM) to learn more about this topic.
+
+### Today widget
+
+The memory limit of a Today widget is 16 MB. As it happens, Today widget implementations using React Native may work unreliably because the memory usage tends to be too high. You can tell if your Today widget is exceeding the memory limit if it yields the message 'Unable to Load':
+
+
+
+Always make sure to test your app extensions in a real device, but be aware that this may not be sufficient, especially when dealing with Today widgets. Debug-configured builds are more likely to exceed the memory limits, while release-configured builds don't fail right away. We highly recommend that you use [Xcode's Instruments](https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/InstrumentsUserGuide/index.html) to analyze your real world memory usage, as it's very likely that your release-configured build is very close to the 16 MB limit. In situations like these, you can quickly go over the 16 MB limit by performing common operations, such as fetching data from an API.
+
+To experiment with the limits of React Native Today widget implementations, try extending the example project in [react-native-today-widget](https://github.com/matejkriz/react-native-today-widget/).
+
+### Other app extensions
+
+Other types of app extensions have greater memory limits than the Today widget. For instance, Custom Keyboard extensions are limited to 48 MB, and Share extensions are limited to 120 MB. Implementing such app extensions with React Native is more viable. One proof of concept example is [react-native-ios-share-extension](https://github.com/andrewsardone/react-native-ios-share-extension).
diff --git a/website/versioned_docs/version-0.70/appearance.md b/website/versioned_docs/version-0.70/appearance.md
new file mode 100644
index 00000000000..8e742ba0821
--- /dev/null
+++ b/website/versioned_docs/version-0.70/appearance.md
@@ -0,0 +1,90 @@
+---
+id: appearance
+title: Appearance
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+```jsx
+import { Appearance } from 'react-native';
+```
+
+The `Appearance` module exposes information about the user's appearance preferences, such as their preferred color scheme (light or dark).
+
+#### Developer notes
+
+
+
+
+
+> The `Appearance` API is inspired by the [Media Queries draft](https://drafts.csswg.org/mediaqueries-5/) from the W3C. The color scheme preference is modeled after the [`prefers-color-scheme` CSS media feature](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme).
+
+
+
+
+> The color scheme preference will map to the user's Light or [Dark theme](https://developer.android.com/guide/topics/ui/look-and-feel/darktheme) preference on Android 10 (API level 29) devices and higher.
+
+
+
+
+> The color scheme preference will map to the user's Light or [Dark Mode](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/dark-mode/) preference on iOS 13 devices and higher.
+
+
+
+
+## Example
+
+You can use the `Appearance` module to determine if the user prefers a dark color scheme:
+
+```jsx
+const colorScheme = Appearance.getColorScheme();
+if (colorScheme === 'dark') {
+ // Use dark color scheme
+}
+```
+
+Although the color scheme is available immediately, this may change (e.g. scheduled color scheme change at sunrise or sunset). Any rendering logic or styles that depend on the user preferred color scheme should try to call this function on every render, rather than caching the value. For example, you may use the [`useColorScheme`](usecolorscheme) React hook as it provides and subscribes to color scheme updates, or you may use inline styles rather than setting a value in a `StyleSheet`.
+
+---
+
+# Reference
+
+## Methods
+
+### `getColorScheme()`
+
+```jsx
+static getColorScheme()
+```
+
+Indicates the current user preferred color scheme. The value may be updated later, either through direct user action (e.g. theme selection in device settings) or on a schedule (e.g. light and dark themes that follow the day/night cycle).
+
+Supported color schemes:
+
+- `light`: The user prefers a light color theme.
+- `dark`: The user prefers a dark color theme.
+- null: The user has not indicated a preferred color theme.
+
+See also: `useColorScheme` hook.
+
+> Note: `getColorScheme()` will always return `light` when debugging with Chrome.
+
+---
+
+### `addChangeListener()`
+
+```jsx
+static addChangeListener(listener)
+```
+
+Add an event handler that is fired when appearance preferences change.
+
+---
+
+### `removeChangeListener()`
+
+```jsx
+static removeChangeListener(listener)
+```
+
+> **Deprecated.** Use the `remove()` method on the event subscription returned by [`addChangeListener()`](#addchangelistener).
diff --git a/website/versioned_docs/version-0.70/appregistry.md b/website/versioned_docs/version-0.70/appregistry.md
new file mode 100644
index 00000000000..0adf5b64772
--- /dev/null
+++ b/website/versioned_docs/version-0.70/appregistry.md
@@ -0,0 +1,392 @@
+---
+id: appregistry
+title: AppRegistry
+---
+
+
+
Project with Native Code Required
+
+ If you are using the managed Expo workflow there is only ever one entry component registered with AppRegistry and it is handled automatically (or through registerRootComponent). You do not need to use this API.
+
+
+
+`AppRegistry` is the JS entry point to running all React Native apps. App root components should register themselves with `AppRegistry.registerComponent`, then the native system can load the bundle for the app and then actually run the app when it's ready by invoking `AppRegistry.runApplication`.
+
+```jsx
+import { Text, AppRegistry } from 'react-native';
+
+const App = (props) => (
+
+ App1
+
+);
+
+AppRegistry.registerComponent('Appname', () => App);
+```
+
+To "stop" an application when a view should be destroyed, call `AppRegistry.unmountApplicationComponentAtRootTag` with the tag that was passed into `runApplication`. These should always be used as a pair.
+
+`AppRegistry` should be required early in the `require` sequence to make sure the JS execution environment is setup before other modules are required.
+
+---
+
+# Reference
+
+## Methods
+
+### `cancelHeadlessTask()`
+
+```jsx
+static cancelHeadlessTask(taskId, taskKey)
+```
+
+Only called from native code. Cancels a headless task.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------------------------------------------------------------ | ------ | --------------------------------------------------------------------------------------- |
+| taskId
Required
| number | The native id for this task instance that was used when `startHeadlessTask` was called. |
+| taskKey
Required
| string | The key for the task that was used when `startHeadlessTask` was called. |
+
+---
+
+### `enableArchitectureIndicator()`
+
+```jsx
+static enableArchitectureIndicator(enabled)
+```
+
+**Parameters:**
+
+| Name | Type |
+| ------------------------------------------------------------ | ------- |
+| enabled
| string |
+
+---
+
+### `getSectionKeys()`
+
+```jsx
+static getSectionKeys()
+```
+
+Returns an array of strings.
+
+---
+
+### `getSections()`
+
+```jsx
+static getSections()
+```
+
+Returns a [Runnables](appregistry#runnables) object.
+
+---
+
+### `registerCancellableHeadlessTask()`
+
+```jsx
+static registerCancellableHeadlessTask(taskKey, taskProvider, taskCancelProvider)
+```
+
+Register a headless task which can be cancelled. A headless task is a bit of code that runs without a UI.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------------------------------------------------------------------------------------- | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| taskKey
Required
| string | The native id for this task instance that was used when startHeadlessTask was called. |
+| taskProvider
Required
| [TaskProvider](appregistry#taskprovider) | A promise returning function that takes some data passed from the native side as the only argument. When the promise is resolved or rejected the native side is notified of this event and it may decide to destroy the JS context. |
+| taskCancelProvider
Required
| [TaskCancelProvider](appregistry#taskcancelprovider) | a void returning function that takes no arguments; when a cancellation is requested, the function being executed by taskProvider should wrap up and return ASAP. |
+
+---
+
+### `registerComponent()`
+
+```jsx
+static registerComponent(appKey, componentProvider, section?)
+```
+
+**Parameters:**
+
+| Name | Type |
+| ---------------------------------------------------------------------- | ----------------- |
+| appKey
| [AppConfig](appregistry#appconfig) |
+
+---
+
+### `registerHeadlessTask()`
+
+```jsx
+static registerHeadlessTask(taskKey, taskProvider)
+```
+
+Register a headless task. A headless task is a bit of code that runs without a UI.
+
+This is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music.
+
+**Parameters:**
+
+| Name | Type | Description |
+| --------------------------------------------------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| taskKey
Required
| string | The native id for this task instance that was used when startHeadlessTask was called. |
+| taskProvider
Required
| [TaskProvider](appregistry#taskprovider) | A promise returning function that takes some data passed from the native side as the only argument. When the promise is resolved or rejected the native side is notified of this event and it may decide to destroy the JS context. |
+
+---
+
+### `registerRunnable()`
+
+```jsx
+static registerRunnable(appKey, run)
+```
+
+**Parameters:**
+
+| Name | Type |
+| ----------------------------------------------------------- | -------- |
+| appKey
Required
| string |
+| run
Required
| function |
+
+---
+
+### `registerSection()`
+
+```jsx
+static registerSection(appKey, component)
+```
+
+**Parameters:**
+
+| Name | Type |
+| -------------------------------------------------------------- | ----------------- |
+| appKey
Required
| string |
+| component
Required
| ComponentProvider |
+
+---
+
+### `runApplication()`
+
+```jsx
+static runApplication(appKey, appParameters)
+```
+
+Loads the JavaScript bundle and runs the app.
+
+**Parameters:**
+
+| Name | Type |
+| ------------------------------------------------------------------ | ------ |
+| appKey
Required
| string |
+| appParameters
Required
| any |
+
+---
+
+### `setComponentProviderInstrumentationHook()`
+
+```jsx
+static setComponentProviderInstrumentationHook(hook)
+```
+
+**Parameters:**
+
+| Name | Type |
+| --------------------------------------------------------- | -------- |
+| hook
Required
| function |
+
+A valid `hook` function accepts the following as arguments:
+
+| Name | Type |
+| ---------------------------------------------------------------------------- | ------------------ |
+| component
Required
| ComponentProvider |
+| scopedPerformanceLogger
Required
| IPerformanceLogger |
+
+The function must also return a React Component.
+
+---
+
+### `setWrapperComponentProvider()`
+
+```jsx
+static setWrapperComponentProvider(provider)
+```
+
+**Parameters:**
+
+| Name | Type |
+| ------------------------------------------------------------- | ----------------- |
+| provider
Required
| ComponentProvider |
+
+---
+
+### `startHeadlessTask()`
+
+```jsx
+static startHeadlessTask(taskId, taskKey, data)
+```
+
+Only called from native code. Starts a headless task.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------------------------------------------------------------ | ------ | -------------------------------------------------------------------- |
+| taskId
Required
| number | The native id for this task instance to keep track of its execution. |
+| taskKey
Required
| string | The key for the task to start. |
+| data
Required
| any | The data to pass to the task. |
+
+---
+
+### `unmountApplicationComponentAtRootTag()`
+
+```jsx
+static unmountApplicationComponentAtRootTag(rootTag)
+```
+
+Stops an application when a view should be destroyed.
+
+**Parameters:**
+
+| Name | Type |
+| ------------------------------------------------------------ | ------ |
+| rootTag
Required
| number |
+
+## Type Definitions
+
+### AppConfig
+
+Application configuration for the `registerConfig` method.
+
+| Type |
+| ------ |
+| object |
+
+**Properties:**
+
+| Name | Type |
+| ----------------------------------------------------------- | ----------------- |
+| appKey
Required
| string |
+| component | ComponentProvider |
+| run | function |
+| section | boolean |
+
+> **Note:** Every config is expected to set either `component` or `run` function.
+
+### Registry
+
+| Type |
+| ------ |
+| object |
+
+**Properties:**
+
+| Name | Type |
+| --------- | ------------------------------------------ |
+| runnables | array of [Runnables](appregistry#runnable) |
+| sections | array of strings |
+
+### Runnable
+
+| Type |
+| ------ |
+| object |
+
+**Properties:**
+
+| Name | Type |
+| --------- | ----------------- |
+| component | ComponentProvider |
+| run | function |
+
+### Runnables
+
+An object with key of `appKey` and value of type of [`Runnable`](appregistry#runnable).
+
+| Type |
+| ------ |
+| object |
+
+### Task
+
+A `Task` is a function that accepts any data as argument and returns a Promise that resolves to `undefined`.
+
+| Type |
+| -------- |
+| function |
+
+### TaskCanceller
+
+A `TaskCanceller` is a function that accepts no argument and returns void.
+
+| Type |
+| -------- |
+| function |
+
+### TaskCancelProvider
+
+A valid `TaskCancelProvider` is a function that returns a [`TaskCanceller`](appregistry#taskcanceller).
+
+| Type |
+| -------- |
+| function |
+
+### TaskProvider
+
+A valid `TaskProvider` is a function that returns a [`Task`](appregistry#task).
+
+| Type |
+| -------- |
+| function |
diff --git a/website/versioned_docs/version-0.70/appstate.md b/website/versioned_docs/version-0.70/appstate.md
new file mode 100644
index 00000000000..9ba3b7d3533
--- /dev/null
+++ b/website/versioned_docs/version-0.70/appstate.md
@@ -0,0 +1,182 @@
+---
+id: appstate
+title: AppState
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+`AppState` can tell you if the app is in the foreground or background, and notify you when the state changes.
+
+AppState is frequently used to determine the intent and proper behavior when handling push notifications.
+
+### App States
+
+- `active` - The app is running in the foreground
+- `background` - The app is running in the background. The user is either:
+ - in another app
+ - on the home screen
+ - [Android] on another `Activity` (even if it was launched by your app)
+- [iOS] `inactive` - This is a state that occurs when transitioning between foreground & background, and during periods of inactivity such as entering the multitasking view, opening the Notification Center or in the event of an incoming call.
+
+For more information, see [Apple's documentation](https://developer.apple.com/documentation/uikit/app_and_scenes/managing_your_app_s_life_cycle)
+
+## Basic Usage
+
+To see the current state, you can check `AppState.currentState`, which will be kept up-to-date. However, `currentState` will be null at launch while `AppState` retrieves it over the bridge.
+
+
+
+
+```SnackPlayer name=AppState%20Function%20Component%20Example
+import React, { useRef, useState, useEffect } from "react";
+import { AppState, StyleSheet, Text, View } from "react-native";
+
+const AppStateExample = () => {
+ const appState = useRef(AppState.currentState);
+ const [appStateVisible, setAppStateVisible] = useState(appState.current);
+
+ useEffect(() => {
+ const subscription = AppState.addEventListener("change", nextAppState => {
+ if (
+ appState.current.match(/inactive|background/) &&
+ nextAppState === "active"
+ ) {
+ console.log("App has come to the foreground!");
+ }
+
+ appState.current = nextAppState;
+ setAppStateVisible(appState.current);
+ console.log("AppState", appState.current);
+ });
+
+ return () => {
+ subscription.remove();
+ };
+ }, []);
+
+ return (
+
+ Current state is: {appStateVisible}
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center",
+ },
+});
+
+export default AppStateExample;
+```
+
+If you don't want to see the AppState update from `active` to `inactive` on iOS you can remove the state variable and use the `appState.current` value.
+
+
+
+
+```SnackPlayer name=AppState%20Class%20Component%20Example
+import React, { Component } from "react";
+import { AppState, StyleSheet, Text, View } from "react-native";
+
+class AppStateExample extends Component {
+ state = {
+ appState: AppState.currentState
+ };
+
+ componentDidMount() {
+ this.appStateSubscription = AppState.addEventListener(
+ "change",
+ nextAppState => {
+ if (
+ this.state.appState.match(/inactive|background/) &&
+ nextAppState === "active"
+ ) {
+ console.log("App has come to the foreground!");
+ }
+ this.setState({ appState: nextAppState });
+ }
+ );
+ }
+
+ componentWillUnmount() {
+ this.appStateSubscription.remove();
+ }
+
+ render() {
+ return (
+
+ Current state is: {this.state.appState}
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center"
+ }
+});
+
+export default AppStateExample;
+```
+
+
+
+
+This example will only ever appear to say "Current state is: active" because the app is only visible to the user when in the `active` state, and the null state will happen only momentarily. If you want to experiment with the code we recommend to use your own device instead of embedded preview.
+
+---
+
+# Reference
+
+## Events
+
+### `change`
+
+This event is received when the app state has changed. The listener is called with one of [the current app state values](appstate#app-states).
+
+### `memoryWarning`
+
+This event is used in the need of throwing memory warning or releasing it.
+
+### `focus`
Android
+
+Received when the app gains focus (the user is interacting with the app).
+
+### `blur`
Android
+
+Received when the user is not actively interacting with the app. Useful in situations when the user pulls down the [notification drawer](https://developer.android.com/guide/topics/ui/notifiers/notifications#bar-and-drawer). `AppState` won't change but the `blur` event will get fired.
+
+## Methods
+
+### `addEventListener()`
+
+```jsx
+addEventListener(eventType, listener);
+```
+
+Sets up a function that will be called whenever the specified event type on AppState occurs. Valid values for `eventType` are
+[listed above](#events). Returns the `EventSubscription`.
+
+---
+
+### `removeEventListener()`
+
+```jsx
+removeEventListener(eventType, listener);
+```
+
+> **Deprecated.** Use the `remove()` method on the `EventSubscription` returned by [`addEventListener()`](#addeventlistener).
+
+## Properties
+
+### `currentState`
+
+```jsx
+AppState.currentState;
+```
diff --git a/website/versioned_docs/version-0.70/asyncstorage.md b/website/versioned_docs/version-0.70/asyncstorage.md
new file mode 100644
index 00000000000..04e507f8b57
--- /dev/null
+++ b/website/versioned_docs/version-0.70/asyncstorage.md
@@ -0,0 +1,365 @@
+---
+id: asyncstorage
+title: '🚧 AsyncStorage'
+---
+
+> **Deprecated.** Use one of the [community packages](https://reactnative.directory/?search=storage) instead.
+
+`AsyncStorage` is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app. It should be used instead of LocalStorage.
+
+It is recommended that you use an abstraction on top of `AsyncStorage` instead of `AsyncStorage` directly for anything more than light usage since it operates globally.
+
+On iOS, `AsyncStorage` is backed by native code that stores small values in a serialized dictionary and larger values in separate files. On Android, `AsyncStorage` will use either [RocksDB](http://rocksdb.org/) or SQLite based on what is available.
+
+The `AsyncStorage` JavaScript code is a facade that provides a clear JavaScript API, real `Error` objects, and non-multi functions. Each method in the API returns a `Promise` object.
+
+Importing the `AsyncStorage` library:
+
+```jsx
+import { AsyncStorage } from 'react-native';
+```
+
+Persisting data:
+
+```jsx
+_storeData = async () => {
+ try {
+ await AsyncStorage.setItem(
+ '@MySuperStore:key',
+ 'I like to save it.'
+ );
+ } catch (error) {
+ // Error saving data
+ }
+};
+```
+
+Fetching data:
+
+```jsx
+_retrieveData = async () => {
+ try {
+ const value = await AsyncStorage.getItem('TASKS');
+ if (value !== null) {
+ // We have data!!
+ console.log(value);
+ }
+ } catch (error) {
+ // Error retrieving data
+ }
+};
+```
+
+---
+
+# Reference
+
+## Methods
+
+### `getItem()`
+
+```jsx
+static getItem(key: string, [callback]: ?(error: ?Error, result: ?string) => void)
+```
+
+Fetches an item for a `key` and invokes a callback upon completion. Returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | ------------------------------------------- | -------- | ----------------------------------------------------------------- |
+| key | string | Yes | Key of the item to fetch. |
+| callback | `?(error: ?Error, result: ?string) => void` | No | Function that will be called with a result if found or any error. |
+
+---
+
+### `setItem()`
+
+```jsx
+static setItem(key: string, value: string, [callback]: ?(error: ?Error) => void)
+```
+
+Sets the value for a `key` and invokes a callback upon completion. Returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------------------------- | -------- | -------------------------------------------- |
+| key | string | Yes | Key of the item to set. |
+| value | string | Yes | Value to set for the `key`. |
+| callback | `?(error: ?Error) => void` | No | Function that will be called with any error. |
+
+---
+
+### `removeItem()`
+
+```jsx
+static removeItem(key: string, [callback]: ?(error: ?Error) => void)
+```
+
+Removes an item for a `key` and invokes a callback upon completion. Returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------------------------- | -------- | -------------------------------------------- |
+| key | string | Yes | Key of the item to remove. |
+| callback | `?(error: ?Error) => void` | No | Function that will be called with any error. |
+
+---
+
+### `mergeItem()`
+
+```jsx
+static mergeItem(key: string, value: string, [callback]: ?(error: ?Error) => void)
+```
+
+Merges an existing `key` value with an input value, assuming both values are stringified JSON. Returns a `Promise` object.
+
+**NOTE:** This is not supported by all native implementations.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------------------------- | -------- | -------------------------------------------- |
+| key | string | Yes | Key of the item to modify. |
+| value | string | Yes | New value to merge for the `key`. |
+| callback | `?(error: ?Error) => void` | No | Function that will be called with any error. |
+
+Example:
+
+```jsx
+let UID123_object = {
+ name: 'Chris',
+ age: 30,
+ traits: { hair: 'brown', eyes: 'brown' }
+};
+// You only need to define what will be added or updated
+let UID123_delta = {
+ age: 31,
+ traits: { eyes: 'blue', shoe_size: 10 }
+};
+
+AsyncStorage.setItem(
+ 'UID123',
+ JSON.stringify(UID123_object),
+ () => {
+ AsyncStorage.mergeItem(
+ 'UID123',
+ JSON.stringify(UID123_delta),
+ () => {
+ AsyncStorage.getItem('UID123', (err, result) => {
+ console.log(result);
+ });
+ }
+ );
+ }
+);
+
+// Console log result:
+// => {'name':'Chris','age':31,'traits':
+// {'shoe_size':10,'hair':'brown','eyes':'blue'}}
+```
+
+---
+
+### `clear()`
+
+```jsx
+static clear([callback]: ?(error: ?Error) => void)
+```
+
+Erases _all_ `AsyncStorage` for all clients, libraries, etc. You probably don't want to call this; use `removeItem` or `multiRemove` to clear only your app's keys. Returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | -------------------------- | -------- | -------------------------------------------- |
+| callback | `?(error: ?Error) => void` | No | Function that will be called with any error. |
+
+---
+
+### `getAllKeys()`
+
+```jsx
+static getAllKeys([callback]: ?(error: ?Error, keys: ?Array) => void)
+```
+
+Gets _all_ keys known to your app; for all callers, libraries, etc. Returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | ------------------------------------------------ | -------- | --------------------------------------------------------------- |
+| callback | `?(error: ?Error, keys: ?Array) => void` | No | Function that will be called with all keys found and any error. |
+
+---
+
+### `flushGetRequests()`
+
+```jsx
+static flushGetRequests(): [object Object]
+```
+
+Flushes any pending requests using a single batch call to get the data.
+
+---
+
+### `multiGet()`
+
+```jsx
+static multiGet(keys: Array, [callback]: ?(errors: ?Array, result: ?Array>) => void)
+```
+
+This allows you to batch the fetching of items given an array of `key` inputs. Your callback will be invoked with an array of corresponding key-value pairs found:
+
+```
+multiGet(['k1', 'k2'], cb) -> cb([['k1', 'val1'], ['k2', 'val2']])
+```
+
+The method returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | ----------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
+| keys | `Array` | Yes | Array of key for the items to get. |
+| callback | `?(errors: ?Array, result: ?Array>) => void` | No | Function that will be called with a key-value array of the results, plus an array of any key-specific errors found. |
+
+Example:
+
+```jsx
+AsyncStorage.getAllKeys((err, keys) => {
+ AsyncStorage.multiGet(keys, (err, stores) => {
+ stores.map((result, i, store) => {
+ // get at each store's key/value so you can work with it
+ let key = store[i][0];
+ let value = store[i][1];
+ });
+ });
+});
+```
+
+---
+
+### `multiSet()`
+
+```jsx
+static multiSet(keyValuePairs: Array>, [callback]: ?(errors: ?Array) => void)
+```
+
+Use this as a batch operation for storing multiple key-value pairs. When the operation completes you'll get a single callback with any errors:
+
+```
+multiSet([['k1', 'val1'], ['k2', 'val2']], cb);
+```
+
+The method returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ------------- | ---------------------------------- | -------- | ---------------------------------------------------------------------------- |
+| keyValuePairs | `Array>` | Yes | Array of key-value array for the items to set. |
+| callback | `?(errors: ?Array) => void` | No | Function that will be called with an array of any key-specific errors found. |
+
+---
+
+### `multiRemove()`
+
+```jsx
+static multiRemove(keys: Array, [callback]: ?(errors: ?Array) => void)
+```
+
+Call this to batch the deletion of all keys in the `keys` array. Returns a `Promise` object.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------- | ---------------------------------- | -------- | ----------------------------------------------------------------------- |
+| keys | `Array` | Yes | Array of key for the items to delete. |
+| callback | `?(errors: ?Array) => void` | No | Function that will be called an array of any key-specific errors found. |
+
+Example:
+
+```jsx
+let keys = ['k1', 'k2'];
+AsyncStorage.multiRemove(keys, (err) => {
+ // keys k1 & k2 removed, if they existed
+ // do most stuff after removal (if you want)
+});
+```
+
+---
+
+### `multiMerge()`
+
+```jsx
+static multiMerge(keyValuePairs: Array>, [callback]: ?(errors: ?Array) => void)
+```
+
+Batch operation to merge in existing and new values for a given set of keys. This assumes that the values are stringified JSON. Returns a `Promise` object.
+
+**NOTE**: This is not supported by all native implementations.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ------------- | ---------------------------------- | -------- | ---------------------------------------------------------------------------- |
+| keyValuePairs | `Array>` | Yes | Array of key-value array for the items to merge. |
+| callback | `?(errors: ?Array) => void` | No | Function that will be called with an array of any key-specific errors found. |
+
+Example:
+
+```jsx
+// first user, initial values
+let UID234_object = {
+ name: 'Chris',
+ age: 30,
+ traits: { hair: 'brown', eyes: 'brown' }
+};
+
+// first user, delta values
+let UID234_delta = {
+ age: 31,
+ traits: { eyes: 'blue', shoe_size: 10 }
+};
+
+// second user, initial values
+let UID345_object = {
+ name: 'Marge',
+ age: 25,
+ traits: { hair: 'blonde', eyes: 'blue' }
+};
+
+// second user, delta values
+let UID345_delta = {
+ age: 26,
+ traits: { eyes: 'green', shoe_size: 6 }
+};
+
+let multi_set_pairs = [
+ ['UID234', JSON.stringify(UID234_object)],
+ ['UID345', JSON.stringify(UID345_object)]
+];
+let multi_merge_pairs = [
+ ['UID234', JSON.stringify(UID234_delta)],
+ ['UID345', JSON.stringify(UID345_delta)]
+];
+
+AsyncStorage.multiSet(multi_set_pairs, (err) => {
+ AsyncStorage.multiMerge(multi_merge_pairs, (err) => {
+ AsyncStorage.multiGet(['UID234', 'UID345'], (err, stores) => {
+ stores.map((result, i, store) => {
+ let key = store[i][0];
+ let val = store[i][1];
+ console.log(key, val);
+ });
+ });
+ });
+});
+
+// Console log results:
+// => UID234 {"name":"Chris","age":31,"traits":{"shoe_size":10,"hair":"brown","eyes":"blue"}}
+// => UID345 {"name":"Marge","age":26,"traits":{"shoe_size":6,"hair":"blonde","eyes":"green"}}
+```
diff --git a/website/versioned_docs/version-0.70/backhandler.md b/website/versioned_docs/version-0.70/backhandler.md
new file mode 100644
index 00000000000..f86a5730492
--- /dev/null
+++ b/website/versioned_docs/version-0.70/backhandler.md
@@ -0,0 +1,299 @@
+---
+id: backhandler
+title: BackHandler
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+The Backhandler API detects hardware button presses for back navigation, lets you register event listeners for the system's back action, and lets you control how your application responds. It is Android-only.
+
+The event subscriptions are called in reverse order (i.e. the last registered subscription is called first).
+
+- **If one subscription returns true,** then subscriptions registered earlier will not be called.
+- **If no subscription returns true or none are registered,** it programmatically invokes the default back button functionality to exit the app.
+
+> **Warning for modal users:** If your app shows an opened `Modal`, `BackHandler` will not publish any events ([see `Modal` docs](modal#onrequestclose)).
+
+## Pattern
+
+```jsx
+BackHandler.addEventListener('hardwareBackPress', function () {
+ /**
+ * this.onMainScreen and this.goBack are just examples,
+ * you need to use your own implementation here.
+ *
+ * Typically you would use the navigator here to go to the last state.
+ */
+
+ if (!this.onMainScreen()) {
+ this.goBack();
+ /**
+ * When true is returned the event will not be bubbled up
+ * & no other back action will execute
+ */
+ return true;
+ }
+ /**
+ * Returning false will let the event to bubble up & let other event listeners
+ * or the system's default back action to be executed.
+ */
+ return false;
+});
+```
+
+## Example
+
+The following example implements a scenario where you confirm if the user wants to exit the app:
+
+
+
+
+```SnackPlayer name=BackHandler&supportedPlatforms=android
+import React, { useEffect } from "react";
+import { Text, View, StyleSheet, BackHandler, Alert } from "react-native";
+
+const App = () => {
+ useEffect(() => {
+ const backAction = () => {
+ Alert.alert("Hold on!", "Are you sure you want to go back?", [
+ {
+ text: "Cancel",
+ onPress: () => null,
+ style: "cancel"
+ },
+ { text: "YES", onPress: () => BackHandler.exitApp() }
+ ]);
+ return true;
+ };
+
+ const backHandler = BackHandler.addEventListener(
+ "hardwareBackPress",
+ backAction
+ );
+
+ return () => backHandler.remove();
+ }, []);
+
+ return (
+
+ Click Back button!
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ text: {
+ fontSize: 18,
+ fontWeight: "bold"
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=BackHandler&supportedPlatforms=android
+import React, { Component } from "react";
+import { Text, View, StyleSheet, BackHandler, Alert } from "react-native";
+
+class App extends Component {
+ backAction = () => {
+ Alert.alert("Hold on!", "Are you sure you want to go back?", [
+ {
+ text: "Cancel",
+ onPress: () => null,
+ style: "cancel"
+ },
+ { text: "YES", onPress: () => BackHandler.exitApp() }
+ ]);
+ return true;
+ };
+
+ componentDidMount() {
+ this.backHandler = BackHandler.addEventListener(
+ "hardwareBackPress",
+ this.backAction
+ );
+ }
+
+ componentWillUnmount() {
+ this.backHandler.remove();
+ }
+
+ render() {
+ return (
+
+ Click Back button!
+
+ );
+ }
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ text: {
+ fontSize: 18,
+ fontWeight: "bold"
+ }
+});
+
+export default App;
+```
+
+
+
+
+`BackHandler.addEventListener` creates an event listener & returns a `NativeEventSubscription` object which should be cleared using `NativeEventSubscription.remove` method.
+
+Additionally `BackHandler.removeEventListener` can also be used to clear the event listener. Ensure the callback has the reference to the same function used in the `addEventListener` call as shown the following example ﹣
+
+
+
+
+```SnackPlayer name=BackHandler&supportedPlatforms=android
+import React, { useEffect } from "react";
+import { Text, View, StyleSheet, BackHandler, Alert } from "react-native";
+
+const App = () => {
+ const backAction = () => {
+ Alert.alert("Hold on!", "Are you sure you want to go back?", [
+ {
+ text: "Cancel",
+ onPress: () => null,
+ style: "cancel"
+ },
+ { text: "YES", onPress: () => BackHandler.exitApp() }
+ ]);
+ return true;
+ };
+
+ useEffect(() => {
+ BackHandler.addEventListener("hardwareBackPress", backAction);
+
+ return () =>
+ BackHandler.removeEventListener("hardwareBackPress", backAction);
+ }, []);
+
+ return (
+
+ Click Back button!
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ text: {
+ fontSize: 18,
+ fontWeight: "bold"
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=BackHandler&supportedPlatforms=android
+import React, { Component } from "react";
+import { Text, View, StyleSheet, BackHandler, Alert } from "react-native";
+
+class App extends Component {
+ backAction = () => {
+ Alert.alert("Hold on!", "Are you sure you want to go back?", [
+ {
+ text: "Cancel",
+ onPress: () => null,
+ style: "cancel"
+ },
+ { text: "YES", onPress: () => BackHandler.exitApp() }
+ ]);
+ return true;
+ };
+
+ componentDidMount() {
+ BackHandler.addEventListener("hardwareBackPress", this.backAction);
+ }
+
+ componentWillUnmount() {
+ BackHandler.removeEventListener("hardwareBackPress", this.backAction);
+ }
+
+ render() {
+ return (
+
+ Click Back button!
+
+ );
+ }
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center"
+ },
+ text: {
+ fontSize: 18,
+ fontWeight: "bold"
+ }
+});
+
+export default App;
+```
+
+
+
+
+## Usage with React Navigation
+
+If you are using React Navigation to navigate across different screens, you can follow their guide on [Custom Android back button behaviour](https://reactnavigation.org/docs/custom-android-back-button-handling/)
+
+## Backhandler hook
+
+[React Native Hooks](https://github.com/react-native-community/hooks#usebackhandler) has a nice `useBackHandler` hook which will simplify the process of setting up event listeners.
+
+---
+
+# Reference
+
+## Methods
+
+### `addEventListener()`
+
+```jsx
+static addEventListener(eventName, handler)
+```
+
+---
+
+### `exitApp()`
+
+```jsx
+static exitApp()
+```
+
+---
+
+### `removeEventListener()`
+
+```jsx
+static removeEventListener(eventName, handler)
+```
diff --git a/website/versioned_docs/version-0.70/build-speed.md b/website/versioned_docs/version-0.70/build-speed.md
new file mode 100644
index 00000000000..7cbcacb390c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/build-speed.md
@@ -0,0 +1,235 @@
+---
+id: build-speed
+title: Speeding up your Build phase
+---
+
+Building your React Native app could be **expensive** and take several minutes of developers time.
+This can be problematic as your project grows and generally in bigger organizations with multiple React Native developers.
+
+With [the New React Native Architecture](/docs/next/new-architecture-app-modules-android), this problem is becoming more critical
+as you might have to compile some native C++ code in your project with the Android NDK in addition to the native code already necessary for the iOS and Android platforms.
+
+To mitigate this performance hit, this page shares some suggestions on how to **improve your build time**.
+
+## Build only one ABI during development (Android-only)
+
+When building your android app locally, by default you build all the 4 [Application Binary Interfaces (ABIs)](https://developer.android.com/ndk/guides/abis) : `armeabi-v7a`, `arm64-v8a`, `x86` & `x86_64`.
+
+However, you probably don't need to build all of them if you're building locally and testing your emulator or on a physical device.
+
+This should reduce your build time by a **~75% factor**.
+
+If you're using the React Native CLI, you can use the `--active-arch-only` flag together with the `run-android` command.
+This flag will make sure the correct ABI is picked up from either the running emulator or the plugged in phone.
+To confirm that this approach is working fine, you'll see a message like `info Detected architectures arm64-v8a` on console.
+
+```
+$ yarn react-native run-android --active-arch-only
+
+[ ... ]
+info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
+Jetifier found 1037 file(s) to forward-jetify. Using 32 workers...
+info JS server already running.
+info Detected architectures arm64-v8a
+info Installing the app...
+```
+
+This mechanism relies on the `reactNativeArchitectures` Gradle property.
+
+Therefore, if you're building directly with Gradle from the command line and without the CLI, you can specify the ABI you want to build as follows:
+
+```
+$ ./gradlew :app:assembleDebug -PreactNativeArchitectures=x86,x86_64
+```
+
+This can be useful if you wish to build your Android App on a CI and use a matrix to parallelize the build of the different architectures.
+
+If you wish, you can also override this value locally, using the `gradle.properties` file you have in the [top-level folder](https://github.com/facebook/react-native/blob/19cf70266eb8ca151aa0cc46ac4c09cb987b2ceb/template/android/gradle.properties#L30-L33) of your project:
+
+```
+# Use this property to specify which architecture you want to build.
+# You can also override it from the CLI using
+# ./gradlew -PreactNativeArchitectures=x86_64
+reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
+```
+
+Once you build a **release version** of your app, don't forget to remove those flags as you want to build an apk/app bundle that works for all the ABIs and not only for the one you're using in your daily development workflow.
+
+## Use a compiler cache
+
+If you're running frequent native builds (either C++ or Objective-C), you might benefit from using a **compiler cache**.
+
+Specifically you can use two type of caches: local compiler caches and distributed compiler caches.
+
+### Local caches
+
+:::info
+The following instructions will work for **both Android & iOS**.
+If you're building only Android apps, you should be good to go.
+If you're building also iOS apps, please follow the instructions in the [XCode Specific Setup](#xcode-specific-setup) section below.
+:::
+
+We suggest to use [**ccache**](https://ccache.dev/) to cache the compilation of your native builds.
+Ccache works by wrapping the C++ compilers, storing the compilation results, and skipping the compilation
+if an intermediate compilation result was originally stored.
+
+To install it, you can follow the [official installation instructions](https://github.com/ccache/ccache/blob/master/doc/INSTALL.md).
+
+On Mac OS, we can install ccache with `brew install ccache`.
+Once installed you can configure it as follows to cache NDK compile results:
+
+```
+ln -s ccache /usr/local/bin/gcc
+ln -s ccache /usr/local/bin/g++
+ln -s ccache /usr/local/bin/cc
+ln -s ccache /usr/local/bin/c++
+ln -s ccache /usr/local/bin/clang
+ln -s ccache /usr/local/bin/clang++
+```
+
+This will create symbolic links to `ccache` inside the `/usr/local/bin/` which are called `gcc`, `g++`, and so on.
+
+This works as long as `/usr/local/bin/` comes first than `/usr/bin/` inside your `$PATH` variable, which is the default.
+
+You can verify that it works using the `which` command:
+
+```
+$ which gcc
+/usr/local/bin/gcc
+```
+
+If the results is `/usr/local/bin/gcc`, then you're effectively calling `ccache` which will wrap the `gcc` calls.
+
+:::caution
+Please note that this setup of `ccache` will affect all the compilations that you're running on your machine, not only those related to React Native. Use it at your own risk. If you're failing to install/compile other software, this might be the reason. If that is the case, you can remove the symlink you created with:
+
+```
+unlink /usr/local/bin/gcc
+unlink /usr/local/bin/g++
+unlink /usr/local/bin/cc
+unlink /usr/local/bin/c++
+unlink /usr/local/bin/clang
+unlink /usr/local/bin/clang++
+```
+
+to revert your machine to the original status and use the default compilers.
+:::
+
+You can then do two clean builds (e.g. on Android you can first run `yarn react-native run-android`, delete the `android/app/build` folder and run the first command once more). You will notice that the second build was way faster than the first one (it should take seconds rather than minutes).
+While building, you can verify that `ccache` works correctly and check the cache hits/miss rate `ccache -s`
+
+```
+$ ccache -s
+Summary:
+ Hits: 196 / 3068 (6.39 %)
+ Direct: 0 / 3068 (0.00 %)
+ Preprocessed: 196 / 3068 (6.39 %)
+ Misses: 2872
+ Direct: 3068
+ Preprocessed: 2872
+ Uncacheable: 1
+Primary storage:
+ Hits: 196 / 6136 (3.19 %)
+ Misses: 5940
+ Cache size (GB): 0.60 / 20.00 (3.00 %)
+```
+
+Note that `ccache` aggregates the stats over all builds. You can use `ccache --zero-stats` to reset them before a build to verify the cache-hit ratio.
+
+Should you need to wipe your cache, you can do so with `ccache --clear`
+
+#### XCode Specific Setup
+
+To make sure `ccache` works correctly with iOS and XCode, you need to follow a couple of extra steps:
+
+1. You must alter the way Xcode and `xcodebuild` call for the compiler command. By default they use _fully specified paths_ to the compiler binaries, so the symbolic links installed in `/usr/local/bin` will not be used. You may configure Xcode to use _relative_ names for the compilers using either of these two options:
+
+- environment variables prefixed on the command line if you use a direct command line: `CLANG=clang CLANGPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ xcodebuild `
+- A `post_install` section in your `ios/Podfile` that alters the compiler in your Xcode workspace during the `pod install` step:
+
+```ruby
+ post_install do |installer|
+ react_native_post_install(installer)
+
+ # ...possibly other post_install items here
+
+ installer.pods_project.targets.each do |target|
+ target.build_configurations.each do |config|
+ # Using the un-qualified names means you can swap in different implementations, for example ccache
+ config.build_settings["CC"] = "clang"
+ config.build_settings["LD"] = "clang"
+ config.build_settings["CXX"] = "clang++"
+ config.build_settings["LDPLUSPLUS"] = "clang++"
+ end
+ end
+
+ __apply_Xcode_12_5_M1_post_install_workaround(installer)
+ end
+```
+
+2. You need a ccache configuration that allows for a certain level of sloppiness and cache behavior such that ccache registers cache hits during Xcode compiles. The ccache configuration variables that are different from standard are as follows if configured by environment variable:
+
+```bash
+export CCACHE_SLOPPINESS=clang_index_store,file_stat_matches,include_file_ctime,include_file_mtime,ivfsoverlay,pch_defines,modules,system_headers,time_macros
+export CCACHE_FILECLONE=true
+export CCACHE_DEPEND=true
+export CCACHE_INODECACHE=true
+```
+
+The same may be configured in a `ccache.conf` file or any other mechanism ccache provides. More on this can be found in the [official ccache manual](https://ccache.dev/manual/4.3.html).
+
+#### Using this approach on a CI
+
+Ccache uses the `/Users/$USER/Library/Caches/ccache` folder on macOS to store the cache.
+Therefore you could save & restore the corresponding folder also on CI to speedup your builds.
+
+However, there are a couple of things to be aware:
+
+1. On CI, we recommend to do a full clean build, to avoid poisoned cache problems. If you follow the approach mentioned in the previous paragraph, you should be able to parallelize the native build on 4 different ABIs and you will most likely not need `ccache` on CI.
+
+2. `ccache` relies on timestamps to compute a cache hit. This doesn't work well on CI as files are re-downloaded at every CI run. To overcome this, you'll need to use the `compiler_check content` option which relies instead on [hashing the content of the file](https://ccache.dev/manual/4.3.html).
+
+### Distributed caches
+
+Similar to local caches, you might want to consider using a distributed cache for your native builds.
+This could be specifically useful in bigger organizations that are doing frequent native builds.
+
+We recommend to use [sccache](https://github.com/mozilla/sccache) to achieve this.
+We defer to the sccache [distributed compilation quickstart](https://github.com/mozilla/sccache/blob/main/docs/DistributedQuickstart.md) for instructions on how to setup and use this tool.
+
+## Troubleshooting
+
+Please find instructions on how to solve some of the most common build performance issue in this section.
+
+### Clean Android build with `--active-arch-only` is failing.
+
+If you're using the `--active-arch-only` flag on a clean Android build (e.g. after having cloned a project or after having created a new project) you might experience a build failures as follows:
+
+```
+Android NDK: ERROR:/.../android/app/src/main/jni/Android.mk:fb: LOCAL_SRC_FILES points to a missing file
+Android NDK: Check that /.../android/app/build/react-ndk/exported/armeabi-v7a/libfb.so exists or that its path is correct
+
+/.../Android/sdk/ndk/24.0.8079956/build/core/prebuilt-library.mk:51: *** Android NDK: Aborting . Stop.
+```
+
+To overcome this, you can either:
+
+1. Run a full build before without `--active-arch-only`. Subsequent builds with `--active-arch-only` will work correctly.
+2. Add an `abiFilter` block inside your `android/app/build.gradle` file [as follows](https://github.com/facebook/react-native/commit/5dff920177220ae5f4e37c662c63c27ebf696c83):
+
+```diff
+ android {
+ defaultConfig {
+
+ // ...
+
++ if (!enableSeparateBuildPerCPUArchitecture) {
++ ndk {
++ abiFilters (*reactNativeArchitectures())
++ }
++ }
+ }
+ }
+```
+
+Projects created with React Native 0.69 and subsequent versions already contain this fix.
diff --git a/website/versioned_docs/version-0.70/building-for-tv.md b/website/versioned_docs/version-0.70/building-for-tv.md
new file mode 100644
index 00000000000..f5e52bf1400
--- /dev/null
+++ b/website/versioned_docs/version-0.70/building-for-tv.md
@@ -0,0 +1,191 @@
+---
+id: building-for-tv
+title: Building For TV Devices
+hide_table_of_contents: true
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+TV devices support has been implemented with the intention of making existing React Native applications work on Apple TV and Android TV, with few or no changes needed in the JavaScript code for the applications.
+
+
+
+
+
+## Build changes
+
+- _Native layer_: To run React Native project on Android TV make sure to make the following changes to `AndroidManifest.xml`
+
+```xml
+
+
+ ...
+
+ ...
+
+
+
+ ...
+
+```
+
+- _JavaScript layer_: Support for Android TV has been added to `Platform.android.js`. You can check whether code is running on Android TV by doing
+
+```js
+var Platform = require('Platform');
+var running_on_android_tv = Platform.isTV;
+```
+
+## Code changes
+
+- _Access to touchable controls_: When running on Android TV the Android framework will automatically apply a directional navigation scheme based on relative position of focusable elements in your views. The `Touchable` mixin has code added to detect focus changes and use existing methods to style the components properly and initiate the proper actions when the view is selected using the TV remote, so `TouchableWithoutFeedback`, `TouchableHighlight`, `TouchableOpacity` and `TouchableNativeFeedback` will work as expected. In particular:
+
+ - `onFocus` will be executed when the touchable view goes into focus
+ - `onBlur` will be executed when the touchable view goes out of focus
+ - `onPress` will be executed when the touchable view is actually selected by pressing the "select" button on the TV remote.
+
+- _TV remote/keyboard input_: A new native class, `ReactAndroidTVRootViewHelper`, sets up key events handlers for TV remote events. When TV remote events occur, this class fires a JS event. This event will be picked up by instances of the `TVEventHandler` JavaScript object. Application code that needs to implement custom handling of TV remote events can create an instance of `TVEventHandler` and listen for these events, as in the following code:
+
+```jsx
+var TVEventHandler = require('TVEventHandler');
+
+class Game2048 extends React.Component {
+ _tvEventHandler: any;
+
+ _enableTVEventHandler() {
+ this._tvEventHandler = new TVEventHandler();
+ this._tvEventHandler.enable(this, function (cmp, evt) {
+ if (evt && evt.eventType === 'right') {
+ cmp.setState({ board: cmp.state.board.move(2) });
+ } else if (evt && evt.eventType === 'up') {
+ cmp.setState({ board: cmp.state.board.move(1) });
+ } else if (evt && evt.eventType === 'left') {
+ cmp.setState({ board: cmp.state.board.move(0) });
+ } else if (evt && evt.eventType === 'down') {
+ cmp.setState({ board: cmp.state.board.move(3) });
+ } else if (evt && evt.eventType === 'playPause') {
+ cmp.restartGame();
+ }
+ });
+ }
+
+ _disableTVEventHandler() {
+ if (this._tvEventHandler) {
+ this._tvEventHandler.disable();
+ delete this._tvEventHandler;
+ }
+ }
+
+ componentDidMount() {
+ this._enableTVEventHandler();
+ }
+
+ componentWillUnmount() {
+ this._disableTVEventHandler();
+ }
+}
+```
+
+- _Dev Menu support_: On the emulator, cmd-M will bring up the developer menu, similar to Android. To bring it up on a real Android TV device, press the menu button or long press the fast-forward button on the remote. (Please do not shake the Android TV device, that will not work :) )
+
+- _Known issues_:
+
+ - `TextInput` components do not work for now (i.e. they cannot receive focus automatically, see [this comment](https://github.com/facebook/react-native/pull/16500#issuecomment-629285638)).
+ - It is however possible to use a ref to manually trigger `inputRef.current.focus()`.
+ - You can wrap your input inside a `TouchableWithoutFeedback` component and trigger focus in the `onFocus` event of that touchable. This enables opening the keyboard via the arrow keys.
+ - The keyboard might reset its state after each keypress (this might only happen inside the Android TV emulator).
+ - The content of `Modal` components cannot receive focus, see [this issue](https://github.com/facebook/react-native/issues/24448) for details.
+
+
+
+
+> **Deprecated.** Use [react-native-tvos](https://github.com/react-native-community/react-native-tvos) instead. For the details please check the [0.62 release blog post](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos).
+
+## Build changes
+
+- _Native layer_: React Native Xcode projects all now have Apple TV build targets, with names ending in the string '-tvOS'.
+
+- _react-native init_: New React Native projects created with `react-native init` will have Apple TV target automatically created in their XCode projects.
+
+- _JavaScript layer_: Support for Apple TV has been added to `Platform.ios.js`. You can check whether code is running on AppleTV by doing
+
+```jsx
+var Platform = require('Platform');
+var running_on_tv = Platform.isTV;
+
+// If you want to be more specific and only detect devices running tvOS
+// (but no Android TV devices) you can use:
+var running_on_apple_tv = Platform.isTVOS;
+```
+
+## Code changes
+
+- _General support for tvOS_: Apple TV specific changes in native code are all wrapped by the TARGET_OS_TV define. These include changes to suppress APIs that are not supported on tvOS (e.g. web views, sliders, switches, status bar, etc.), and changes to support user input from the TV remote or keyboard.
+
+- _Common codebase_: Since tvOS and iOS share most Objective-C and JavaScript code in common, most documentation for iOS applies equally to tvOS.
+
+- _Access to touchable controls_: When running on Apple TV, the native view class is `RCTTVView`, which has additional methods to make use of the tvOS focus engine. The `Touchable` mixin has code added to detect focus changes and use existing methods to style the components properly and initiate the proper actions when the view is selected using the TV remote, so `TouchableWithoutFeedback`, `TouchableHighlight` and `TouchableOpacity` will work as expected. In particular:
+
+ - `onFocus` will be executed when the touchable view goes into focus
+ - `onBlur` will be executed when the touchable view goes out of focus
+ - `onPress` will be executed when the touchable view is actually selected by pressing the "select" button on the TV remote.
+
+- _TV remote/keyboard input_: A new native class, `RCTTVRemoteHandler`, sets up gesture recognizers for TV remote events. When TV remote events occur, this class fires notifications that are picked up by `RCTTVNavigationEventEmitter` (a subclass of `RCTEventEmitter`), that fires a JS event. This event will be picked up by instances of the `TVEventHandler` JavaScript object. Application code that needs to implement custom handling of TV remote events can create an instance of `TVEventHandler` and listen for these events, as in the following code:
+
+```jsx
+var TVEventHandler = require('TVEventHandler');
+
+class Game2048 extends React.Component {
+ _tvEventHandler: any;
+
+ _enableTVEventHandler() {
+ this._tvEventHandler = new TVEventHandler();
+ this._tvEventHandler.enable(this, function (cmp, evt) {
+ if (evt && evt.eventType === 'right') {
+ cmp.setState({ board: cmp.state.board.move(2) });
+ } else if (evt && evt.eventType === 'up') {
+ cmp.setState({ board: cmp.state.board.move(1) });
+ } else if (evt && evt.eventType === 'left') {
+ cmp.setState({ board: cmp.state.board.move(0) });
+ } else if (evt && evt.eventType === 'down') {
+ cmp.setState({ board: cmp.state.board.move(3) });
+ } else if (evt && evt.eventType === 'playPause') {
+ cmp.restartGame();
+ }
+ });
+ }
+
+ _disableTVEventHandler() {
+ if (this._tvEventHandler) {
+ this._tvEventHandler.disable();
+ delete this._tvEventHandler;
+ }
+ }
+
+ componentDidMount() {
+ this._enableTVEventHandler();
+ }
+
+ componentWillUnmount() {
+ this._disableTVEventHandler();
+ }
+}
+```
+
+- _Dev Menu support_: On the simulator, cmd-D will bring up the developer menu, similar to iOS. To bring it up on a real Apple TV device, make a long press on the play/pause button on the remote. (Please do not shake the Apple TV device, that will not work :) )
+
+- _TV remote animations_: `RCTTVView` native code implements Apple-recommended parallax animations to help guide the eye as the user navigates through views. The animations can be disabled or adjusted with new optional view properties.
+
+- _Back navigation with the TV remote menu button_: The `BackHandler` component, originally written to support the Android back button, now also supports back navigation on the Apple TV using the menu button on the TV remote.
+
+- _TabBarIOS behavior_: The `TabBarIOS` component wraps the native `UITabBar` API, which works differently on Apple TV. To avoid jittery re-rendering of the tab bar in tvOS (see [this issue](https://github.com/facebook/react-native/issues/15081)), the selected tab bar item can only be set from JavaScript on initial render, and is controlled after that by the user through native code.
+
+- _Known issues_:
+
+ - [ListView scrolling](https://github.com/facebook/react-native/issues/12793). The issue can be worked around by setting `removeClippedSubviews` to false in ListView and similar components. For more discussion of this issue, see [this PR](https://github.com/facebook/react-native/pull/12944).
+
+
+
diff --git a/website/versioned_docs/version-0.70/button.md b/website/versioned_docs/version-0.70/button.md
new file mode 100644
index 00000000000..78f7fcaa637
--- /dev/null
+++ b/website/versioned_docs/version-0.70/button.md
@@ -0,0 +1,273 @@
+---
+id: button
+title: Button
+---
+
+A basic button component that should render nicely on any platform. Supports a minimal level of customization.
+
+If this button doesn't look right for your app, you can build your own button using [TouchableOpacity](touchableopacity) or [TouchableWithoutFeedback](touchablewithoutfeedback). For inspiration, look at the [source code for this button component](https://github.com/facebook/react-native/blob/master/Libraries/Components/Button.js). Or, take a look at the [wide variety of button components built by the community](https://js.coach/?menu%5Bcollections%5D=React%20Native&page=1&query=button).
+
+```jsx
+
+```
+
+## Example
+
+```SnackPlayer name=Button%20Example
+import React from 'react';
+import { StyleSheet, Button, View, SafeAreaView, Text, Alert } from 'react-native';
+
+const Separator = () => (
+
+);
+
+const App = () => (
+
+
+
+ The title and onPress handler are required. It is recommended to set accessibilityLabel to help make your app usable by everyone.
+
+
+
+
+
+ Adjust the color in a way that looks standard on each platform. On iOS, the color prop controls the color of the text. On Android, the color adjusts the background color of the button.
+
+
+
+
+
+ All interaction for the component are disabled.
+
+
+
+
+
+ This layout strategy lets the title define the width of the button.
+
+
+
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ marginHorizontal: 16,
+ },
+ title: {
+ textAlign: 'center',
+ marginVertical: 8,
+ },
+ fixToText: {
+ flexDirection: 'row',
+ justifyContent: 'space-between',
+ },
+ separator: {
+ marginVertical: 8,
+ borderBottomColor: '#737373',
+ borderBottomWidth: StyleSheet.hairlineWidth,
+ },
+});
+
+export default App;
+```
+
+---
+
+# Reference
+
+## Props
+
+###
Required
**`onPress`**
+
+Handler to be called when the user taps the button.
+
+| Type |
+| ------------------------------------------- |
+| ({ nativeEvent: [PressEvent](pressevent) }) |
+
+---
+
+###
Required
**`title`**
+
+Text to display inside the button. On Android the given title will be converted to the uppercased form.
+
+| Type |
+| ------ |
+| string |
+
+---
+
+### `accessibilityLabel`
+
+Text to display for blindness accessibility features.
+
+| Type |
+| ------ |
+| string |
+
+---
+
+### `accessibilityLanguage`
iOS
+
+A value indicating which language should be used by the screen reader when the user interacts with the element. It should follow the [BCP 47 specification](https://www.rfc-editor.org/info/bcp47).
+
+See the [iOS `accessibilityLanguage` doc](https://developer.apple.com/documentation/objectivec/nsobject/1615192-accessibilitylanguage) for more information.
+
+| Type |
+| ------ |
+| string |
+
+---
+
+### `accessibilityActions`
+
+Accessibility actions allow an assistive technology to programmatically invoke the actions of a component. The `accessibilityActions` property should contain a list of action objects. Each action object should contain the field name and label.
+
+See the [Accessibility guide](accessibility.md#accessibility-actions) for more information.
+
+| Type | Required |
+| ----- | -------- |
+| array | No |
+
+---
+
+### `onAccessibilityAction`
+
+Invoked when the user performs the accessibility actions. The only argument to this function is an event containing the name of the action to perform.
+
+See the [Accessibility guide](accessibility.md#accessibility-actions) for more information.
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `color`
+
+Color of the text (iOS), or background color of the button (Android).
+
+| Type | Default |
+| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [color](colors) | `'#2196F3'`
Android
`'#007AFF'`
iOS
|
+
+---
+
+### `disabled`
+
+If `true`, disable all interactions for this component.
+
+| Type | Default |
+| ---- | ------- |
+| bool | `false` |
+
+---
+
+### `hasTVPreferredFocus`
+
+Designates the next view to receive focus when the user navigates down. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusDown).
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `nextFocusForward`
Android
TV
+
+Designates the next view to receive focus when the user navigates forward. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusForward).
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `nextFocusLeft`
Android
TV
+
+Designates the next view to receive focus when the user navigates left. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusLeft).
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `nextFocusRight`
Android
TV
+
+Designates the next view to receive focus when the user navigates right. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusRight).
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `nextFocusUp`
Android
TV
+
+Designates the next view to receive focus when the user navigates up. See the [Android documentation](https://developer.android.com/reference/android/view/View.html#attr_android:nextFocusUp).
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `testID`
+
+Used to locate this view in end-to-end tests.
+
+| Type |
+| ------ |
+| string |
+
+---
+
+### `touchSoundDisabled`
Android
+
+If `true`, doesn't play system sound on touch.
+
+| Type | Default |
+| ------- | ------- |
+| boolean | `false` |
diff --git a/website/versioned_docs/version-0.70/checkbox.md b/website/versioned_docs/version-0.70/checkbox.md
new file mode 100644
index 00000000000..9253aa616b2
--- /dev/null
+++ b/website/versioned_docs/version-0.70/checkbox.md
@@ -0,0 +1,113 @@
+---
+id: checkbox
+title: '🚧 CheckBox'
+---
+
+> **Removed.** Use one of the [community packages](https://reactnative.directory/?search=checkbox) instead.
+
+Renders a boolean input (Android only).
+
+This is a controlled component that requires an `onValueChange` callback that updates the `value` prop in order for the component to reflect user actions. If the `value` prop is not updated, the component will continue to render the supplied `value` prop instead of the expected result of any user actions.
+
+## Example
+
+```SnackPlayer name=CheckBox%20Component%20Example&supportedPlatforms=android,web
+import React, { useState } from "react";
+import { CheckBox, Text, StyleSheet, View } from "react-native";
+
+const App = () => {
+ const [isSelected, setSelection] = useState(false);
+
+ return (
+
+
+
+ Do you like React Native?
+
+ Is CheckBox selected: {isSelected ? "👍" : "👎"}
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center",
+ },
+ checkboxContainer: {
+ flexDirection: "row",
+ marginBottom: 20,
+ },
+ checkbox: {
+ alignSelf: "center",
+ },
+ label: {
+ margin: 8,
+ },
+});
+
+export default App;
+```
+
+---
+
+# Reference
+
+## Props
+
+Inherits [View Props](view#props).
+
+---
+
+### `disabled`
+
+If true the user won't be able to toggle the checkbox. Default value is `false`.
+
+| Type | Required |
+| ---- | -------- |
+| bool | No |
+
+---
+
+### `onChange`
+
+Used in case the props change removes the component.
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `onValueChange`
+
+Invoked with the new value when the value changes.
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `testID`
+
+Used to locate this view in end-to-end tests.
+
+| Type | Required |
+| ------ | -------- |
+| string | No |
+
+---
+
+### `value`
+
+The value of the checkbox. If true the checkbox will be turned on. Default value is `false`.
+
+| Type | Required |
+| ---- | -------- |
+| bool | No |
diff --git a/website/versioned_docs/version-0.70/clipboard.md b/website/versioned_docs/version-0.70/clipboard.md
new file mode 100644
index 00000000000..1b33930e84c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/clipboard.md
@@ -0,0 +1,105 @@
+---
+id: clipboard
+title: '🚧 Clipboard'
+---
+
+> **Deprecated.** Use one of the [community packages](https://reactnative.directory/?search=clipboard) instead.
+
+`Clipboard` gives you an interface for setting and getting content from Clipboard on both Android and iOS
+
+---
+
+## Example
+
+```SnackPlayer name=Clipboard%20API%20Example&supportedPlatforms=ios,android
+
+import React, { useState } from 'react'
+import { SafeAreaView, View, Text, TouchableOpacity, Clipboard, StyleSheet } from 'react-native'
+
+const App = () => {
+ const [copiedText, setCopiedText] = useState('')
+
+ const copyToClipboard = () => {
+ Clipboard.setString('hello world')
+ }
+
+ const fetchCopiedText = async () => {
+ const text = await Clipboard.getString()
+ setCopiedText(text)
+ }
+
+ return (
+
+
+ copyToClipboard()}>
+ Click here to copy to Clipboard
+
+ fetchCopiedText()}>
+ View copied text
+
+
+ {copiedText}
+
+
+
+ )
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ alignItems: 'center'
+ },
+ copiedText: {
+ marginTop: 10,
+ color: 'red'
+ }
+})
+
+export default App
+```
+
+# Reference
+
+## Methods
+
+### `getString()`
+
+```jsx
+static getString()
+```
+
+Get content of string type, this method returns a `Promise`, so you can use following code to get clipboard content
+
+```jsx
+async _getContent() {
+ var content = await Clipboard.getString();
+}
+```
+
+---
+
+### `setString()`
+
+```jsx
+static setString(content)
+```
+
+Set content of string type. You can use following code to set clipboard content
+
+```jsx
+_setContent() {
+ Clipboard.setString('hello world');
+}
+```
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| ------- | ------ | -------- | ----------------------------------------- |
+| content | string | Yes | The content to be stored in the clipboard |
+
+_Notice_
+
+Be careful when you're trying to copy to clipboard any data except `string` and `number`, some data need additional stringification. For example, if you will try to copy array - Android will raise an exception, but iOS will not.
diff --git a/website/versioned_docs/version-0.70/colors.md b/website/versioned_docs/version-0.70/colors.md
new file mode 100644
index 00000000000..b396bfbfb38
--- /dev/null
+++ b/website/versioned_docs/version-0.70/colors.md
@@ -0,0 +1,210 @@
+---
+id: colors
+title: Color Reference
+---
+
+Components in React Native are [styled using JavaScript](style). Color properties usually match how [CSS works on the web](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value). General guides on the color usage on each platform could be found below:
+
+- [Android](https://material.io/design/color/color-usage.html)
+- [iOS](https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/)
+
+## Color APIs
+
+React Native has several color APIs designed to allow you to take full advantage of your platform's design and user preferences.
+
+- [PlatformColor](platformcolor) lets you reference the platform's color system.
+- [DynamicColorIOS](dynamiccolorios) is iOS specific and allows you to specify which colors should be used in light or Dark Mode.
+
+## Color representations
+
+### Red Green Blue (RGB)
+
+React Native supports `rgb()` and `rgba()` in both hexadecimal and functional notation:
+
+- `'#f0f'` (#rgb)
+- `'#ff00ff'` (#rrggbb)
+- `'#f0ff'` (#rgba)
+- `'#ff00ff00'` (#rrggbbaa)
+- `'rgb(255, 0, 255)'`
+- `'rgba(255, 0, 255, 1.0)'`
+
+### Hue Saturation Lightness (HSL)
+
+React Native supports `hsl()` and `hsla()` in functional notation:
+
+- `'hsl(360, 100%, 100%)'`
+- `'hsla(360, 100%, 100%, 1.0)'`
+
+### Color ints
+
+React Native supports also colors as an `int` values (in RGB color mode):
+
+- `0xff00ff00` (0xrrggbbaa)
+
+:::caution
+This might appear similar to the Android [Color](https://developer.android.com/reference/android/graphics/Color) ints representation but on Android values are stored in SRGB color mode (0xaarrggbb).
+:::
+
+### Named colors
+
+In React Native you can also use color name strings as values.
+
+:::info
+React Native only supports lowercase color names. Uppercase color names are not supported.
+:::
+
+#### `transparent`
+
+This is a shortcut for `rgba(0,0,0,0)`, same like in [CSS3](https://www.w3.org/TR/css-color-3/#transparent).
+
+#### Color keywords
+
+Named colors implementation follows the [CSS3/SVG specification](https://www.w3.org/TR/css-color-3/#svg-color):
+
+
+
+- aliceblue (`#f0f8ff`)
+- antiquewhite (`#faebd7`)
+- aqua (`#00ffff`)
+- aquamarine (`#7fffd4`)
+- azure (`#f0ffff`)
+- beige (`#f5f5dc`)
+- bisque (`#ffe4c4`)
+- black (`#000000`)
+- blanchedalmond (`#ffebcd`)
+- blue (`#0000ff`)
+- blueviolet (`#8a2be2`)
+- brown (`#a52a2a`)
+- burlywood (`#deb887`)
+- cadetblue (`#5f9ea0`)
+- chartreuse (`#7fff00`)
+- chocolate (`#d2691e`)
+- coral (`#ff7f50`)
+- cornflowerblue (`#6495ed`)
+- cornsilk (`#fff8dc`)
+- crimson (`#dc143c`)
+- cyan (`#00ffff`)
+- darkblue (`#00008b`)
+- darkcyan (`#008b8b`)
+- darkgoldenrod (`#b8860b`)
+- darkgray (`#a9a9a9`)
+- darkgreen (`#006400`)
+- darkgrey (`#a9a9a9`)
+- darkkhaki (`#bdb76b`)
+- darkmagenta (`#8b008b`)
+- darkolivegreen (`#556b2f`)
+- darkorange (`#ff8c00`)
+- darkorchid (`#9932cc`)
+- darkred (`#8b0000`)
+- darksalmon (`#e9967a`)
+- darkseagreen (`#8fbc8f`)
+- darkslateblue (`#483d8b`)
+- darkslategrey (`#2f4f4f`)
+- darkturquoise (`#00ced1`)
+- darkviolet (`#9400d3`)
+- deeppink (`#ff1493`)
+- deepskyblue (`#00bfff`)
+- dimgray (`#696969`)
+- dimgrey (`#696969`)
+- dodgerblue (`#1e90ff`)
+- firebrick (`#b22222`)
+- floralwhite (`#fffaf0`)
+- forestgreen (`#228b22`)
+- fuchsia (`#ff00ff`)
+- gainsboro (`#dcdcdc`)
+- ghostwhite (`#f8f8ff`)
+- gold (`#ffd700`)
+- goldenrod (`#daa520`)
+- gray (`#808080`)
+- green (`#008000`)
+- greenyellow (`#adff2f`)
+- grey (`#808080`)
+- honeydew (`#f0fff0`)
+- hotpink (`#ff69b4`)
+- indianred (`#cd5c5c`)
+- indigo (`#4b0082`)
+- ivory (`#fffff0`)
+- khaki (`#f0e68c`)
+- lavender (`#e6e6fa`)
+- lavenderblush (`#fff0f5`)
+- lawngreen (`#7cfc00`)
+- lemonchiffon (`#fffacd`)
+- lightblue (`#add8e6`)
+- lightcoral (`#f08080`)
+- lightcyan (`#e0ffff`)
+- lightgoldenrodyellow (`#fafad2`)
+- lightgray (`#d3d3d3`)
+- lightgreen (`#90ee90`)
+- lightgrey (`#d3d3d3`)
+- lightpink (`#ffb6c1`)
+- lightsalmon (`#ffa07a`)
+- lightseagreen (`#20b2aa`)
+- lightskyblue (`#87cefa`)
+- lightslategrey (`#778899`)
+- lightsteelblue (`#b0c4de`)
+- lightyellow (`#ffffe0`)
+- lime (`#00ff00`)
+- limegreen (`#32cd32`)
+- linen (`#faf0e6`)
+- magenta (`#ff00ff`)
+- maroon (`#800000`)
+- mediumaquamarine (`#66cdaa`)
+- mediumblue (`#0000cd`)
+- mediumorchid (`#ba55d3`)
+- mediumpurple (`#9370db`)
+- mediumseagreen (`#3cb371`)
+- mediumslateblue (`#7b68ee`)
+- mediumspringgreen (`#00fa9a`)
+- mediumturquoise (`#48d1cc`)
+- mediumvioletred (`#c71585`)
+- midnightblue (`#191970`)
+- mintcream (`#f5fffa`)
+- mistyrose (`#ffe4e1`)
+- moccasin (`#ffe4b5`)
+- navajowhite (`#ffdead`)
+- navy (`#000080`)
+- oldlace (`#fdf5e6`)
+- olive (`#808000`)
+- olivedrab (`#6b8e23`)
+- orange (`#ffa500`)
+- orangered (`#ff4500`)
+- orchid (`#da70d6`)
+- palegoldenrod (`#eee8aa`)
+- palegreen (`#98fb98`)
+- paleturquoise (`#afeeee`)
+- palevioletred (`#db7093`)
+- papayawhip (`#ffefd5`)
+- peachpuff (`#ffdab9`)
+- peru (`#cd853f`)
+- pink (`#ffc0cb`)
+- plum (`#dda0dd`)
+- powderblue (`#b0e0e6`)
+- purple (`#800080`)
+- rebeccapurple (`#663399`)
+- red (`#ff0000`)
+- rosybrown (`#bc8f8f`)
+- royalblue (`#4169e1`)
+- saddlebrown (`#8b4513`)
+- salmon (`#fa8072`)
+- sandybrown (`#f4a460`)
+- seagreen (`#2e8b57`)
+- seashell (`#fff5ee`)
+- sienna (`#a0522d`)
+- silver (`#c0c0c0`)
+- skyblue (`#87ceeb`)
+- slateblue (`#6a5acd`)
+- slategray (`#708090`)
+- snow (`#fffafa`)
+- springgreen (`#00ff7f`)
+- steelblue (`#4682b4`)
+- tan (`#d2b48c`)
+- teal (`#008080`)
+- thistle (`#d8bfd8`)
+- tomato (`#ff6347`)
+- turquoise (`#40e0d0`)
+- violet (`#ee82ee`)
+- wheat (`#f5deb3`)
+- white (`#ffffff`)
+- whitesmoke (`#f5f5f5`)
+- yellow (`#ffff00`)
+- yellowgreen (`#9acd32`)
diff --git a/website/versioned_docs/version-0.70/communication-android.md b/website/versioned_docs/version-0.70/communication-android.md
new file mode 100644
index 00000000000..bcf2dec3037
--- /dev/null
+++ b/website/versioned_docs/version-0.70/communication-android.md
@@ -0,0 +1,149 @@
+---
+id: communication-android
+title: Communication between native and React Native
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+In [Integrating with Existing Apps guide](integration-with-existing-apps) and [Native UI Components guide](native-components-android) we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
+
+## Introduction
+
+React Native is inspired by React, so the basic idea of the information flow is similar. The flow in React is one-directional. We maintain a hierarchy of components, in which each component depends only on its parent and its own internal state. We do this with properties: data is passed from a parent to its children in a top-down manner. If an ancestor component relies on the state of its descendant, one should pass down a callback to be used by the descendant to update the ancestor.
+
+The same concept applies to React Native. As long as we are building our application purely within the framework, we can drive our app with properties and callbacks. But, when we mix React Native and native components, we need some specific, cross-language mechanisms that would allow us to pass information between them.
+
+## Properties
+
+Properties are the most straightforward way of cross-component communication. So we need a way to pass properties both from native to React Native, and from React Native to native.
+
+### Passing properties from native to React Native
+
+You can pass properties down to the React Native app by providing a custom implementation of `ReactActivityDelegate` in your main activity. This implementation should override `getLaunchOptions` to return a `Bundle` with the desired properties.
+
+
+
+
+
+```java
+public class MainActivity extends ReactActivity {
+ @Override
+ protected ReactActivityDelegate createReactActivityDelegate() {
+ return new ReactActivityDelegate(this, getMainComponentName()) {
+ @Override
+ protected Bundle getLaunchOptions() {
+ Bundle initialProperties = new Bundle();
+ ArrayList imageList = new ArrayList(Arrays.asList(
+ "http://foo.com/bar1.png",
+ "http://foo.com/bar2.png"
+ ));
+ initialProperties.putStringArrayList("images", imageList);
+ return initialProperties;
+ }
+ };
+ }
+}
+```
+
+
+
+
+
+```kotlin
+class MainActivity : ReactActivity() {
+ override fun createReactActivityDelegate(): ReactActivityDelegate {
+ return object : ReactActivityDelegate(this, mainComponentName) {
+ override fun getLaunchOptions(): Bundle {
+ val imageList = arrayListOf("http://foo.com/bar1.png", "http://foo.com/bar2.png")
+ val initialProperties = Bundle().apply { putStringArrayList("images", imageList) }
+ return initialProperties
+ }
+ }
+ }
+}
+```
+
+
+
+
+```jsx
+import React from 'react';
+import { View, Image } from 'react-native';
+
+export default class ImageBrowserApp extends React.Component {
+ renderImage(imgURI) {
+ return ;
+ }
+ render() {
+ return {this.props.images.map(this.renderImage)};
+ }
+}
+```
+
+`ReactRootView` provides a read-write property `appProperties`. After `appProperties` is set, the React Native app is re-rendered with new properties. The update is only performed when the new updated properties differ from the previous ones.
+
+
+
+
+
+```java
+Bundle updatedProps = mReactRootView.getAppProperties();
+ArrayList imageList = new ArrayList(Arrays.asList(
+ "http://foo.com/bar3.png",
+ "http://foo.com/bar4.png"
+));
+updatedProps.putStringArrayList("images", imageList);
+
+mReactRootView.setAppProperties(updatedProps);
+```
+
+
+
+
+
+```kotlin
+var updatedProps: Bundle = reactRootView.getAppProperties()
+var imageList = arrayListOf("http://foo.com/bar3.png", "http://foo.com/bar4.png")
+```
+
+
+
+
+
+It is fine to update properties anytime. However, updates have to be performed on the main thread. You use the getter on any thread.
+
+There is no way to update only a few properties at a time. We suggest that you build it into your own wrapper instead.
+
+> **_Note:_** Currently, JS function `componentWillUpdateProps` of the top level RN component will not be called after a prop update. However, you can access the new props in `componentDidMount` function.
+
+### Passing properties from React Native to native
+
+The problem exposing properties of native components is covered in detail in [this article](native-components-android#3-expose-view-property-setters-using-reactprop-or-reactpropgroup-annotation). In short, properties that are to be reflected in JavaScript needs to be exposed as setter method annotated with `@ReactProp`, then use them in React Native as if the component was an ordinary React Native component.
+
+### Limits of properties
+
+The main drawback of cross-language properties is that they do not support callbacks, which would allow us to handle bottom-up data bindings. Imagine you have a small RN view that you want to be removed from the native parent view as a result of a JS action. There is no way to do that with props, as the information would need to go bottom-up.
+
+Although we have a flavor of cross-language callbacks ([described here](native-modules-android#callbacks)), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
+
+## Other ways of cross-language interaction (events and native modules)
+
+As stated in the previous chapter, using properties comes with some limitations. Sometimes properties are not enough to drive the logic of our app and we need a solution that gives more flexibility. This chapter covers other communication techniques available in React Native. They can be used for internal communication (between JS and native layers in RN) as well as for external communication (between RN and the 'pure native' part of your app).
+
+React Native enables you to perform cross-language function calls. You can execute custom native code from JS and vice versa. Unfortunately, depending on the side we are working on, we achieve the same goal in different ways. For native - we use events mechanism to schedule an execution of a handler function in JS, while for React Native we directly call methods exported by native modules.
+
+### Calling React Native functions from native (events)
+
+Events are described in detail in [this article](native-components-android#events). Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
+
+Events are powerful, because they allow us to change React Native components without needing a reference to them. However, there are some pitfalls that you can fall into while using them:
+
+- As events can be sent from anywhere, they can introduce spaghetti-style dependencies into your project.
+- Events share namespace, which means that you may encounter some name collisions. Collisions will not be detected statically, which makes them hard to debug.
+- If you use several instances of the same React Native component and you want to distinguish them from the perspective of your event, you'll likely need to introduce identifiers and pass them along with events (you can use the native view's `reactTag` as an identifier).
+
+### Calling native functions from React Native (native modules)
+
+Native modules are Java/Kotlin classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in [this article](native-modules-android).
+
+> **_Warning_**: All native modules share the same namespace. Watch out for name collisions when creating new ones.
diff --git a/website/versioned_docs/version-0.70/communication-ios.md b/website/versioned_docs/version-0.70/communication-ios.md
new file mode 100644
index 00000000000..6130662a864
--- /dev/null
+++ b/website/versioned_docs/version-0.70/communication-ios.md
@@ -0,0 +1,204 @@
+---
+id: communication-ios
+title: Communication between native and React Native
+---
+
+In [Integrating with Existing Apps guide](integration-with-existing-apps) and [Native UI Components guide](native-components-ios) we learn how to embed React Native in a native component and vice versa. When we mix native and React Native components, we'll eventually find a need to communicate between these two worlds. Some ways to achieve that have been already mentioned in other guides. This article summarizes available techniques.
+
+## Introduction
+
+React Native is inspired by React, so the basic idea of the information flow is similar. The flow in React is one-directional. We maintain a hierarchy of components, in which each component depends only on its parent and its own internal state. We do this with properties: data is passed from a parent to its children in a top-down manner. If an ancestor component relies on the state of its descendant, one should pass down a callback to be used by the descendant to update the ancestor.
+
+The same concept applies to React Native. As long as we are building our application purely within the framework, we can drive our app with properties and callbacks. But, when we mix React Native and native components, we need some specific, cross-language mechanisms that would allow us to pass information between them.
+
+## Properties
+
+Properties are the most straightforward way of cross-component communication. So we need a way to pass properties both from native to React Native, and from React Native to native.
+
+### Passing properties from native to React Native
+
+In order to embed a React Native view in a native component, we use `RCTRootView`. `RCTRootView` is a `UIView` that holds a React Native app. It also provides an interface between native side and the hosted app.
+
+`RCTRootView` has an initializer that allows you to pass arbitrary properties down to the React Native app. The `initialProperties` parameter has to be an instance of `NSDictionary`. The dictionary is internally converted into a JSON object that the top-level JS component can reference.
+
+```objectivec
+NSArray *imageList = @[@"http://foo.com/bar1.png",
+ @"http://foo.com/bar2.png"];
+
+NSDictionary *props = @{@"images" : imageList};
+
+RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
+ moduleName:@"ImageBrowserApp"
+ initialProperties:props];
+```
+
+```jsx
+import React from 'react';
+import { View, Image } from 'react-native';
+
+export default class ImageBrowserApp extends React.Component {
+ renderImage(imgURI) {
+ return ;
+ }
+ render() {
+ return {this.props.images.map(this.renderImage)};
+ }
+}
+```
+
+`RCTRootView` also provides a read-write property `appProperties`. After `appProperties` is set, the React Native app is re-rendered with new properties. The update is only performed when the new updated properties differ from the previous ones.
+
+```objectivec
+NSArray *imageList = @[@"http://foo.com/bar3.png",
+ @"http://foo.com/bar4.png"];
+
+rootView.appProperties = @{@"images" : imageList};
+```
+
+It is fine to update properties anytime. However, updates have to be performed on the main thread. You use the getter on any thread.
+
+:::note
+Currently, there is a known issue where setting appProperties during the bridge startup, the change can be lost. See https://github.com/facebook/react-native/issues/20115 for more information.
+:::
+
+There is no way to update only a few properties at a time. We suggest that you build it into your own wrapper instead.
+
+### Passing properties from React Native to native
+
+The problem exposing properties of native components is covered in detail in [this article](native-components-ios#properties). In short, export properties with `RCT_CUSTOM_VIEW_PROPERTY` macro in your custom native component, then use them in React Native as if the component was an ordinary React Native component.
+
+### Limits of properties
+
+The main drawback of cross-language properties is that they do not support callbacks, which would allow us to handle bottom-up data bindings. Imagine you have a small RN view that you want to be removed from the native parent view as a result of a JS action. There is no way to do that with props, as the information would need to go bottom-up.
+
+Although we have a flavor of cross-language callbacks ([described here](native-modules-ios#callbacks)), these callbacks are not always the thing we need. The main problem is that they are not intended to be passed as properties. Rather, this mechanism allows us to trigger a native action from JS, and handle the result of that action in JS.
+
+## Other ways of cross-language interaction (events and native modules)
+
+As stated in the previous chapter, using properties comes with some limitations. Sometimes properties are not enough to drive the logic of our app and we need a solution that gives more flexibility. This chapter covers other communication techniques available in React Native. They can be used for internal communication (between JS and native layers in RN) as well as for external communication (between RN and the 'pure native' part of your app).
+
+React Native enables you to perform cross-language function calls. You can execute custom native code from JS and vice versa. Unfortunately, depending on the side we are working on, we achieve the same goal in different ways. For native - we use events mechanism to schedule an execution of a handler function in JS, while for React Native we directly call methods exported by native modules.
+
+### Calling React Native functions from native (events)
+
+Events are described in detail in [this article](native-components-ios#events). Note that using events gives us no guarantees about execution time, as the event is handled on a separate thread.
+
+Events are powerful, because they allow us to change React Native components without needing a reference to them. However, there are some pitfalls that you can fall into while using them:
+
+- As events can be sent from anywhere, they can introduce spaghetti-style dependencies into your project.
+- Events share namespace, which means that you may encounter some name collisions. Collisions will not be detected statically, which makes them hard to debug.
+- If you use several instances of the same React Native component and you want to distinguish them from the perspective of your event, you'll likely need to introduce identifiers and pass them along with events (you can use the native view's `reactTag` as an identifier).
+
+The common pattern we use when embedding native in React Native is to make the native component's RCTViewManager a delegate for the views, sending events back to JavaScript via the bridge. This keeps related event calls in one place.
+
+### Calling native functions from React Native (native modules)
+
+Native modules are Objective-C classes that are available in JS. Typically one instance of each module is created per JS bridge. They can export arbitrary functions and constants to React Native. They have been covered in detail in [this article](native-modules-ios#content).
+
+The fact that native modules are singletons limits the mechanism in the context of embedding. Let's say we have a React Native component embedded in a native view and we want to update the native, parent view. Using the native module mechanism, we would export a function that not only takes expected arguments, but also an identifier of the parent native view. The identifier would be used to retrieve a reference to the parent view to update. That said, we would need to keep a mapping from identifiers to native views in the module.
+
+Although this solution is complex, it is used in `RCTUIManager`, which is an internal React Native class that manages all React Native views.
+
+Native modules can also be used to expose existing native libraries to JS. The [Geolocation library](https://github.com/michalchudziak/react-native-geolocation) is a living example of the idea.
+
+:::caution
+All native modules share the same namespace. Watch out for name collisions when creating new ones.
+:::
+
+## Layout computation flow
+
+When integrating native and React Native, we also need a way to consolidate two different layout systems. This section covers common layout problems and provides a brief description of mechanisms to address them.
+
+### Layout of a native component embedded in React Native
+
+This case is covered in [this article](native-components-ios#styles). To summarize, since all our native react views are subclasses of `UIView`, most style and size attributes will work like you would expect out of the box.
+
+### Layout of a React Native component embedded in native
+
+#### React Native content with fixed size
+
+The general scenario is when we have a React Native app with a fixed size, which is known to the native side. In particular, a full-screen React Native view falls into this case. If we want a smaller root view, we can explicitly set RCTRootView's frame.
+
+For instance, to make an RN app 200 (logical) pixels high, and the hosting view's width wide, we could do:
+
+```objectivec title='SomeViewController.m'
+- (void)viewDidLoad
+{
+ [...]
+ RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
+ moduleName:appName
+ initialProperties:props];
+ rootView.frame = CGRectMake(0, 0, self.view.width, 200);
+ [self.view addSubview:rootView];
+}
+```
+
+When we have a fixed size root view, we need to respect its bounds on the JS side. In other words, we need to ensure that the React Native content can be contained within the fixed-size root view. The easiest way to ensure this is to use Flexbox layout. If you use absolute positioning, and React components are visible outside the root view's bounds, you'll get overlap with native views, causing some features to behave unexpectedly. For instance, 'TouchableHighlight' will not highlight your touches outside the root view's bounds.
+
+It's totally fine to update root view's size dynamically by re-setting its frame property. React Native will take care of the content's layout.
+
+#### React Native content with flexible size
+
+In some cases we'd like to render content of initially unknown size. Let's say the size will be defined dynamically in JS. We have two solutions to this problem.
+
+1. You can wrap your React Native view in a `ScrollView` component. This guarantees that your content will always be available and it won't overlap with native views.
+2. React Native allows you to determine, in JS, the size of the RN app and provide it to the owner of the hosting `RCTRootView`. The owner is then responsible for re-laying out the subviews and keeping the UI consistent. We achieve this with `RCTRootView`'s flexibility modes.
+
+`RCTRootView` supports 4 different size flexibility modes:
+
+```objectivec title='RCTRootView.h'
+typedef NS_ENUM(NSInteger, RCTRootViewSizeFlexibility) {
+ RCTRootViewSizeFlexibilityNone = 0,
+ RCTRootViewSizeFlexibilityWidth,
+ RCTRootViewSizeFlexibilityHeight,
+ RCTRootViewSizeFlexibilityWidthAndHeight,
+};
+```
+
+`RCTRootViewSizeFlexibilityNone` is the default value, which makes a root view's size fixed (but it still can be updated with `setFrame:`). The other three modes allow us to track React Native content's size updates. For instance, setting mode to `RCTRootViewSizeFlexibilityHeight` will cause React Native to measure the content's height and pass that information back to `RCTRootView`'s delegate. An arbitrary action can be performed within the delegate, including setting the root view's frame, so the content fits. The delegate is called only when the size of the content has changed.
+
+:::caution
+Making a dimension flexible in both JS and native leads to undefined behavior. For example - don't make a top-level React component's width flexible (with `flexbox`) while you're using `RCTRootViewSizeFlexibilityWidth` on the hosting `RCTRootView`.
+:::
+
+Let's look at an example.
+
+```objectivec title='FlexibleSizeExampleView.m'
+- (instancetype)initWithFrame:(CGRect)frame
+{
+ [...]
+
+ _rootView = [[RCTRootView alloc] initWithBridge:bridge
+ moduleName:@"FlexibilityExampleApp"
+ initialProperties:@{}];
+
+ _rootView.delegate = self;
+ _rootView.sizeFlexibility = RCTRootViewSizeFlexibilityHeight;
+ _rootView.frame = CGRectMake(0, 0, self.frame.size.width, 0);
+}
+
+#pragma mark - RCTRootViewDelegate
+- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView
+{
+ CGRect newFrame = rootView.frame;
+ newFrame.size = rootView.intrinsicContentSize;
+
+ rootView.frame = newFrame;
+}
+```
+
+In the example we have a `FlexibleSizeExampleView` view that holds a root view. We create the root view, initialize it and set the delegate. The delegate will handle size updates. Then, we set the root view's size flexibility to `RCTRootViewSizeFlexibilityHeight`, which means that `rootViewDidChangeIntrinsicSize:` method will be called every time the React Native content changes its height. Finally, we set the root view's width and position. Note that we set there height as well, but it has no effect as we made the height RN-dependent.
+
+You can checkout full source code of the example [here](https://github.com/facebook/react-native/blob/master/packages/rn-tester/RNTester/NativeExampleViews/FlexibleSizeExampleView.m).
+
+It's fine to change root view's size flexibility mode dynamically. Changing flexibility mode of a root view will schedule a layout recalculation and the delegate `rootViewDidChangeIntrinsicSize:` method will be called once the content size is known.
+
+:::note
+React Native layout calculation is performed on a separate thread, while native UI view updates are done on the main thread.
+This may cause temporary UI inconsistencies between native and React Native. This is a known problem and our team is working on synchronizing UI updates coming from different sources.
+:::
+
+:::note
+React Native does not perform any layout calculations until the root view becomes a subview of some other views.
+If you want to hide React Native view until its dimensions are known, add the root view as a subview and make it initially hidden (use `UIView`'s `hidden` property). Then change its visibility in the delegate method.
+:::
diff --git a/website/versioned_docs/version-0.70/components-and-apis.md b/website/versioned_docs/version-0.70/components-and-apis.md
new file mode 100644
index 00000000000..555d419118a
--- /dev/null
+++ b/website/versioned_docs/version-0.70/components-and-apis.md
@@ -0,0 +1,207 @@
+---
+id: components-and-apis
+title: Core Components and APIs
+---
+
+React Native provides a number of built-in [Core Components](intro-react-native-components) ready for you to use in your app. You can find them all in the left sidebar (or menu above, if you are on a narrow screen). If you're not sure where to get started, take a look at the following categories:
+
+- [Basic Components](components-and-apis#basic-components)
+- [User Interface](components-and-apis#user-interface)
+- [List Views](components-and-apis#list-views)
+- [Android-specific](components-and-apis#android-components-and-apis)
+- [iOS-specific](components-and-apis#ios-components-and-apis)
+- [Others](components-and-apis#others)
+
+You're not limited to the components and APIs bundled with React Native. React Native has a community of thousands of developers. If you're looking for a library that does something specific, please refer to [this guide about finding libraries](libraries#finding-libraries).
+
+## Basic Components
+
+Most apps will end up using one of these basic components.
+
+
+
+## List Views
+
+Unlike the more generic [`ScrollView`](./scrollview), the following list view components only render elements that are currently showing on the screen. This makes them a performant choice for displaying long lists of data.
+
+
+
+## Others
+
+These components may be useful for certain applications. For an exhaustive list of components and APIs, check out the sidebar to the left (or menu above, if you are on a narrow screen).
+
+
diff --git a/website/versioned_docs/version-0.70/custom-webview-android.md b/website/versioned_docs/version-0.70/custom-webview-android.md
new file mode 100644
index 00000000000..581f230e1a2
--- /dev/null
+++ b/website/versioned_docs/version-0.70/custom-webview-android.md
@@ -0,0 +1,403 @@
+---
+id: custom-webview-android
+title: Custom WebView
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+While the built-in web view has a lot of features, it is not possible to handle every use-case in React Native. You can, however, extend the web view with native code without forking React Native or duplicating all the existing web view code.
+
+:::info
+The React Native WebView component has been extracted to [`react-native-webview`](https://github.com/react-native-webview/react-native-webview) package as part of the [Lean Core effort](https://github.com/facebook/react-native/issues/23313).
+That is the recommended way to use WebView in React Native as of today. You should not use the [WebView](https://reactnative.dev/docs/0.61/webview) component as that was deprecated and removed from React Native.
+:::
+
+Before you do this, you should be familiar with the concepts in [native UI components](native-components-android). You should also familiarise yourself with the [native code for web views](https://github.com/react-native-webview/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java), as you will have to use this as a reference when implementing new features—although a deep understanding is not required.
+
+## Native Code
+
+:::info
+This example assumes you already have [`react-native-webview`](https://github.com/react-native-webview/react-native-webview) installed, if not please follow their [Getting Started guide](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Getting-Started.md) first.
+:::
+
+To get started, you'll need to create a subclass of `RNCWebViewManager`, `RNCWebView`, and `RNCWebViewClient`. In your view manager, you'll then need to override:
+
+- `createRNCWebViewInstance`
+- `getName`
+- `addEventEmitters`
+
+
+
+
+```java
+@ReactModule(name = CustomWebViewManager.REACT_CLASS)
+public class CustomWebViewManager extends RNCWebViewManager {
+ /* This name must match what we're referring to in JS */
+ protected static final String REACT_CLASS = "RCTCustomWebView";
+
+ protected static class CustomWebViewClient extends RNCWebViewClient { }
+
+ protected static class CustomWebView extends RNCWebView {
+ public CustomWebView(ThemedReactContext reactContext) {
+ super(reactContext);
+ }
+ }
+
+ @Override
+ protected RNCWebView createRNCWebViewInstance(ThemedReactContext reactContext) {
+ return new CustomWebView(reactContext);
+ }
+
+ @Override
+ public String getName() {
+ return REACT_CLASS;
+ }
+
+ @Override
+ protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {
+ view.setWebViewClient(new CustomWebViewClient());
+ }
+}
+```
+
+
+
+
+```kotlin
+@ReactModule(name = CustomWebViewManager.REACT_CLASS)
+class CustomWebViewManager : RNCWebViewManager() {
+ protected class CustomWebViewClient : RNCWebViewClient()
+ protected inner class CustomWebView(reactContext: ThemedReactContext?) :
+ RNCWebView(reactContext)
+
+ override fun createRNCWebViewInstance(reactContext: ThemedReactContext?): RNCWebView {
+ return CustomWebView(reactContext)
+ }
+
+ override fun addEventEmitters(reactContext: ThemedReactContext, view: WebView) {
+ view.webViewClient = CustomWebViewClient()
+ }
+
+ companion object {
+ /* This name must match what we're referring to in JS */
+ const val REACT_CLASS = "RCTCustomWebView"
+ }
+}
+```
+
+
+
+
+You'll need to follow the usual steps to [register the module](native-modules-android.md#register-the-module).
+
+### Adding New Properties
+
+To add a new property, you'll need to add it to `CustomWebView`, and then expose it in `CustomWebViewManager`.
+
+
+
+
+```java
+public class CustomWebViewManager extends RNCWebViewManager {
+ ...
+ protected static class CustomWebView extends RNCWebView {
+ public CustomWebView(ThemedReactContext reactContext) {
+ super(reactContext);
+ }
+
+ protected @Nullable String mFinalUrl;
+
+ public void setFinalUrl(String url) {
+ mFinalUrl = url;
+ }
+
+ public String getFinalUrl() {
+ return mFinalUrl;
+ }
+ }
+
+ ...
+
+ @ReactProp(name = "finalUrl")
+ public void setFinalUrl(WebView view, String url) {
+ ((CustomWebView) view).setFinalUrl(url);
+ }
+}
+```
+
+
+
+
+```kotlin
+class CustomWebViewManager : RNCWebViewManager() {
+ protected inner class CustomWebView(
+ reactContext: ThemedReactContext?,
+ var finalUrl: String? = null
+ ) : RNCWebView(reactContext)
+
+ @ReactProp(name = "finalUrl")
+ fun setFinalUrl(view: WebView, url: String?) {
+ (view as CustomWebView).finalUrl = url
+ }
+}
+```
+
+
+
+
+### Adding New Events
+
+For events, you'll first need to make create event subclass.
+
+
+
+
+```java
+// NavigationCompletedEvent.java
+public class NavigationCompletedEvent extends Event {
+ private WritableMap mParams;
+
+ public NavigationCompletedEvent(int viewTag, WritableMap params) {
+ super(viewTag);
+ this.mParams = params;
+ }
+
+ @Override
+ public String getEventName() {
+ return "navigationCompleted";
+ }
+
+ @Override
+ public void dispatch(RCTEventEmitter rctEventEmitter) {
+ init(getViewTag());
+ rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mParams);
+ }
+}
+```
+
+
+
+
+```kotlin
+// NavigationCompletedEvent.kt
+class NavigationCompletedEvent(viewTag: Int, val params: WritableMap) :
+ Event(viewTag) {
+ override fun getEventName(): String = "navigationCompleted"
+
+ override fun dispatch(rctEventEmitter: RCTEventEmitter) {
+ init(viewTag)
+ rctEventEmitter.receiveEvent(viewTag, eventName, params)
+ }
+}
+```
+
+
+
+
+You can trigger the event in your web view client. You can hook existing handlers if your events are based on them.
+
+You should refer to [RNCWebViewManager.java](https://github.com/react-native-webview/react-native-webview/blob/master/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java) in the React Native WebView codebase to see what handlers are available and how they are implemented. You can extend any methods here to provide extra functionality.
+
+
+
+
+```java
+public class NavigationCompletedEvent extends Event {
+ private WritableMap mParams;
+
+ public NavigationCompletedEvent(int viewTag, WritableMap params) {
+ super(viewTag);
+ this.mParams = params;
+ }
+
+ @Override
+ public String getEventName() {
+ return "navigationCompleted";
+ }
+
+ @Override
+ public void dispatch(RCTEventEmitter rctEventEmitter) {
+ init(getViewTag());
+ rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mParams);
+ }
+}
+
+// CustomWebViewManager.java
+protected static class CustomWebViewClient extends RNCWebViewClient {
+ @Override
+ public boolean shouldOverrideUrlLoading(WebView view, String url) {
+ boolean shouldOverride = super.shouldOverrideUrlLoading(view, url);
+ String finalUrl = ((CustomWebView) view).getFinalUrl();
+
+ if (!shouldOverride && url != null && finalUrl != null && new String(url).equals(finalUrl)) {
+ final WritableMap params = Arguments.createMap();
+ dispatchEvent(view, new NavigationCompletedEvent(view.getId(), params));
+ }
+
+ return shouldOverride;
+ }
+}
+```
+
+
+
+
+```kotlin
+class NavigationCompletedEvent(viewTag: Int, val params: WritableMap) :
+ Event(viewTag) {
+
+ override fun getEventName(): String = "navigationCompleted"
+
+ override fun dispatch(rctEventEmitter: RCTEventEmitter) {
+ init(viewTag)
+ rctEventEmitter.receiveEvent(viewTag, eventName, params)
+ }
+}
+
+// CustomWebViewManager.kt
+
+protected class CustomWebViewClient : RNCWebViewClient() {
+ override fun shouldOverrideUrlLoading(view: WebView, url: String?): Boolean {
+ val shouldOverride: Boolean = super.shouldOverrideUrlLoading(view, url)
+ val finalUrl: String? = (view as CustomWebView).finalUrl
+ if (!shouldOverride && url != null && finalUrl != null && url == finalUrl) {
+ val params: WritableMap = Arguments.createMap()
+ dispatchEvent(view, NavigationCompletedEvent(view.getId(), params))
+ }
+ return shouldOverride
+ }
+}
+```
+
+
+
+
+Finally, you'll need to expose the events in `CustomWebViewManager` through `getExportedCustomDirectEventTypeConstants`. Note that currently, the default implementation returns `null`, but this may change in the future.
+
+
+
+
+```java
+public class CustomWebViewManager extends RNCWebViewManager {
+ ...
+
+ @Override
+ public @Nullable
+ Map getExportedCustomDirectEventTypeConstants() {
+ Map export = super.getExportedCustomDirectEventTypeConstants();
+ if (export == null) {
+ export = MapBuilder.newHashMap();
+ }
+ export.put("navigationCompleted", MapBuilder.of("registrationName", "onNavigationCompleted"));
+ return export;
+ }
+}
+```
+
+
+
+
+```kotlin
+class CustomWebViewManager : RNCWebViewManager() {
+ override fun getExportedCustomDirectEventTypeConstants(): MutableMap? {
+ val superTypeConstants = super.getExportedCustomDirectEventTypeConstants()
+ val export = superTypeConstants ?: MapBuilder.newHashMap()
+ export["navigationCompleted"] = MapBuilder.of("registrationName", "onNavigationCompleted")
+ return export
+ }
+}
+```
+
+
+
+
+## JavaScript Interface
+
+To use your custom web view, you'll need to create a class for it. Your class must:
+
+- Export all the prop types from `WebView.propTypes`
+- Return a `WebView` component with the prop `nativeConfig.component` set to your native component (see below)
+
+To get your native component, you must use `requireNativeComponent`: the same as for regular custom components. However, you must pass in an extra third argument, `WebView.extraNativeComponentConfig`. This third argument contains prop types that are only required for native code.
+
+```jsx
+import React, { Component, PropTypes } from 'react';
+import { WebView, requireNativeComponent } from 'react-native';
+
+export default class CustomWebView extends Component {
+ static propTypes = WebView.propTypes;
+
+ render() {
+ return (
+
+ );
+ }
+}
+
+const RCTCustomWebView = requireNativeComponent(
+ 'RCTCustomWebView',
+ CustomWebView,
+ WebView.extraNativeComponentConfig
+);
+```
+
+If you want to add custom props to your native component, you can use `nativeConfig.props` on the web view.
+
+For events, the event handler must always be set to a function. This means it isn't safe to use the event handler directly from `this.props`, as the user might not have provided one. The standard approach is to create a event handler in your class, and then invoking the event handler given in `this.props` if it exists.
+
+If you are unsure how something should be implemented from the JS side, look at [WebView.android.js](https://github.com/react-native-webview/react-native-webview/blob/master/src/WebView.android.tsx) in the React Native WebView source.
+
+```jsx
+export default class CustomWebView extends Component {
+ static propTypes = {
+ ...WebView.propTypes,
+ finalUrl: PropTypes.string,
+ onNavigationCompleted: PropTypes.func
+ };
+
+ static defaultProps = {
+ finalUrl: 'about:blank'
+ };
+
+ _onNavigationCompleted = (event) => {
+ const { onNavigationCompleted } = this.props;
+ onNavigationCompleted && onNavigationCompleted(event);
+ };
+
+ render() {
+ return (
+
+ );
+ }
+}
+```
+
+Similar to regular native components, you must provide all your prop types in the component to have them forwarded on to the native component. However, if you have some prop types that are only used internally in component, you can add them to the `nativeOnly` property of the third argument previously mentioned. For event handlers, you have to use the value `true` instead of a regular prop type.
+
+For example, if you wanted to add an internal event handler called `onScrollToBottom`, you would use,
+
+```jsx
+const RCTCustomWebView = requireNativeComponent(
+ 'RCTCustomWebView',
+ CustomWebView,
+ {
+ ...WebView.extraNativeComponentConfig,
+ nativeOnly: {
+ ...WebView.extraNativeComponentConfig.nativeOnly,
+ onScrollToBottom: true
+ }
+ }
+);
+```
diff --git a/website/versioned_docs/version-0.70/custom-webview-ios.md b/website/versioned_docs/version-0.70/custom-webview-ios.md
new file mode 100644
index 00000000000..72675fc4e7d
--- /dev/null
+++ b/website/versioned_docs/version-0.70/custom-webview-ios.md
@@ -0,0 +1,236 @@
+---
+id: custom-webview-ios
+title: Custom WebView
+---
+
+While the built-in web view has a lot of features, it is not possible to handle every use-case in React Native. You can, however, extend the web view with native code without forking React Native or duplicating all the existing web view code.
+
+Before you do this, you should be familiar with the concepts in [native UI components](native-components-ios). You should also familiarise yourself with the [native code for web views](https://github.com/react-native-webview/react-native-webview/blob/master/apple/RNCWebViewManager.m), as you will have to use this as a reference when implementing new features—although a deep understanding is not required.
+
+## Native Code
+
+Like for regular native components, you need a view manager and an web view.
+
+For the view, you'll need to make a subclass of `RCTWebView`.
+
+```objc
+// RCTCustomWebView.h
+#import
+
+@interface RCTCustomWebView : RCTWebView
+
+@end
+
+// RCTCustomWebView.m
+#import "RCTCustomWebView.h"
+
+@interface RCTCustomWebView ()
+
+@end
+
+@implementation RCTCustomWebView { }
+
+@end
+```
+
+For the view manager, you need to make a subclass `RCTWebViewManager`. You must still include:
+
+- `(UIView *)view` that returns your custom view
+- The `RCT_EXPORT_MODULE()` tag
+
+```objc
+// RCTCustomWebViewManager.h
+#import
+
+@interface RCTCustomWebViewManager : RCTWebViewManager
+
+@end
+
+// RCTCustomWebViewManager.m
+#import "RCTCustomWebViewManager.h"
+#import "RCTCustomWebView.h"
+
+@interface RCTCustomWebViewManager ()
+
+@end
+
+@implementation RCTCustomWebViewManager { }
+
+RCT_EXPORT_MODULE()
+
+- (UIView *)view
+{
+ RCTCustomWebView *webView = [RCTCustomWebView new];
+ webView.delegate = self;
+ return webView;
+}
+
+@end
+```
+
+### Adding New Events and Properties
+
+Adding new properties and events is the same as regular UI components. For properties, you define an `@property` in the header. For events, you define a `RCTDirectEventBlock` in the view's `@interface`.
+
+```objc
+// RCTCustomWebView.h
+@property (nonatomic, copy) NSString *finalUrl;
+
+// RCTCustomWebView.m
+@interface RCTCustomWebView ()
+
+@property (nonatomic, copy) RCTDirectEventBlock onNavigationCompleted;
+
+@end
+```
+
+Then expose it in the view manager's `@implementation`.
+
+```objc
+// RCTCustomWebViewManager.m
+RCT_EXPORT_VIEW_PROPERTY(onNavigationCompleted, RCTDirectEventBlock)
+RCT_EXPORT_VIEW_PROPERTY(finalUrl, NSString)
+```
+
+### Extending Existing Events
+
+You should refer to [RCTWebView.m](https://github.com/react-native-webview/react-native-webview/blob/master/apple/RNCWebView.m) in the React Native WebView codebase to see what handlers are available and how they are implemented. You can extend any methods here to provide extra functionality.
+
+By default, most methods aren't exposed from RCTWebView. If you need to expose them, you need to create an [Objective C category](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/CustomizingExistingClasses/CustomizingExistingClasses.html), and then expose all the methods you need to use.
+
+```objc
+// RCTWebView+Custom.h
+#import
+
+@interface RCTWebView (Custom)
+- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
+- (NSMutableDictionary *)baseEvent;
+@end
+```
+
+Once these are exposed, you can reference them in your custom web view class.
+
+```objc
+// RCTCustomWebView.m
+
+// Remember to import the category file.
+#import "RCTWebView+Custom.h"
+
+- (BOOL)webView:(__unused UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
+ navigationType:(UIWebViewNavigationType)navigationType
+{
+ BOOL allowed = [super webView:webView shouldStartLoadWithRequest:request navigationType:navigationType];
+
+ if (allowed) {
+ NSString* url = request.URL.absoluteString;
+ if (url && [url isEqualToString:_finalUrl]) {
+ if (_onNavigationCompleted) {
+ NSMutableDictionary *event = [self baseEvent];
+ _onNavigationCompleted(event);
+ }
+ }
+ }
+
+ return allowed;
+}
+```
+
+## JavaScript Interface
+
+To use your custom web view, you'll need to create a class for it. Your class must:
+
+- Export all the prop types from `WebView.propTypes`
+- Return a `WebView` component with the prop `nativeConfig.component` set to your native component (see below)
+
+To get your native component, you must use `requireNativeComponent`: the same as for regular custom components. However, you must pass in an extra third argument, `WebView.extraNativeComponentConfig`. This third argument contains prop types that are only required for native code.
+
+```jsx
+import React, { Component, PropTypes } from 'react';
+import {
+ WebView,
+ requireNativeComponent,
+ NativeModules
+} from 'react-native';
+const { CustomWebViewManager } = NativeModules;
+
+export default class CustomWebView extends Component {
+ static propTypes = WebView.propTypes;
+
+ render() {
+ return (
+
+ );
+ }
+}
+
+const RCTCustomWebView = requireNativeComponent(
+ 'RCTCustomWebView',
+ CustomWebView,
+ WebView.extraNativeComponentConfig
+);
+```
+
+If you want to add custom props to your native component, you can use `nativeConfig.props` on the web view. For iOS, you should also set the `nativeConfig.viewManager` prop with your custom WebView ViewManager as in the example above.
+
+For events, the event handler must always be set to a function. This means it isn't safe to use the event handler directly from `this.props`, as the user might not have provided one. The standard approach is to create a event handler in your class, and then invoking the event handler given in `this.props` if it exists.
+
+If you are unsure how something should be implemented from the JS side, look at [WebView.ios.tsx](https://github.com/react-native-webview/react-native-webview/blob/master/src/WebView.ios.tsx) in the React Native source.
+
+```jsx
+export default class CustomWebView extends Component {
+ static propTypes = {
+ ...WebView.propTypes,
+ finalUrl: PropTypes.string,
+ onNavigationCompleted: PropTypes.func
+ };
+
+ static defaultProps = {
+ finalUrl: 'about:blank'
+ };
+
+ _onNavigationCompleted = (event) => {
+ const { onNavigationCompleted } = this.props;
+ onNavigationCompleted && onNavigationCompleted(event);
+ };
+
+ render() {
+ return (
+
+ );
+ }
+}
+```
+
+Similar to regular native components, you must provide all your prop types in the component to have them forwarded on to the native component. However, if you have some prop types that are only used internally in component, you can add them to the `nativeOnly` property of the third argument previously mentioned. For event handlers, you have to use the value `true` instead of a regular prop type.
+
+For example, if you wanted to add an internal event handler called `onScrollToBottom`, you would use,
+
+```jsx
+const RCTCustomWebView = requireNativeComponent(
+ 'RCTCustomWebView',
+ CustomWebView,
+ {
+ ...WebView.extraNativeComponentConfig,
+ nativeOnly: {
+ ...WebView.extraNativeComponentConfig.nativeOnly,
+ onScrollToBottom: true
+ }
+ }
+);
+```
diff --git a/website/versioned_docs/version-0.70/datepickerandroid.md b/website/versioned_docs/version-0.70/datepickerandroid.md
new file mode 100644
index 00000000000..ed943d6cbf1
--- /dev/null
+++ b/website/versioned_docs/version-0.70/datepickerandroid.md
@@ -0,0 +1,74 @@
+---
+id: datepickerandroid
+title: '🚧 DatePickerAndroid'
+---
+
+> **Deprecated.** Use one of the [community packages](https://reactnative.directory/?search=datepicker) instead.
+
+Opens the standard Android date picker dialog.
+
+### Example
+
+```jsx
+try {
+ const { action, year, month, day } =
+ await DatePickerAndroid.open({
+ // Use `new Date()` for current date.
+ // May 25 2020. Month 0 is January.
+ date: new Date(2020, 4, 25)
+ });
+ if (action !== DatePickerAndroid.dismissedAction) {
+ // Selected year, month (0-11), day
+ }
+} catch ({ code, message }) {
+ console.warn('Cannot open date picker', message);
+}
+```
+
+---
+
+# Reference
+
+## Methods
+
+### `open()`
+
+```jsx
+static open(options)
+```
+
+Opens the standard Android date picker dialog.
+
+The available keys for the `options` object are:
+
+- `date` (`Date` object or timestamp in milliseconds) - date to show by default
+- `minDate` (`Date` or timestamp in milliseconds) - minimum date that can be selected
+- `maxDate` (`Date` object or timestamp in milliseconds) - maximum date that can be selected
+- `mode` (`enum('calendar', 'spinner', 'default')`) - To set the date-picker mode to calendar/spinner/default
+ - 'calendar': Show a date picker in calendar mode.
+ - 'spinner': Show a date picker in spinner mode.
+ - 'default': Show a default native date picker(spinner/calendar) based on android versions.
+
+Returns a Promise which will be invoked an object containing `action`, `year`, `month` (0-11), `day` if the user picked a date. If the user dismissed the dialog, the Promise will still be resolved with action being `DatePickerAndroid.dismissedAction` and all the other keys being undefined. **Always** check whether the `action` is equal to `DatePickerAndroid.dateSetAction` before reading the values.
+
+Note the native date picker dialog has some UI glitches on Android 4 and lower when using the `minDate` and `maxDate` options.
+
+---
+
+### `dateSetAction()`
+
+```jsx
+static dateSetAction()
+```
+
+A date has been selected.
+
+---
+
+### `dismissedAction()`
+
+```jsx
+static dismissedAction()
+```
+
+The dialog has been dismissed.
diff --git a/website/versioned_docs/version-0.70/datepickerios.md b/website/versioned_docs/version-0.70/datepickerios.md
new file mode 100644
index 00000000000..b20f41ccba4
--- /dev/null
+++ b/website/versioned_docs/version-0.70/datepickerios.md
@@ -0,0 +1,213 @@
+---
+id: datepickerios
+title: '🚧 DatePickerIOS'
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+> **Deprecated.** Use one of the [community packages](https://reactnative.directory/?search=datepicker) instead.
+
+Use `DatePickerIOS` to render a date/time picker (selector) on iOS. This is a controlled component, so you must hook in to the `onDateChange` callback and update the `date` prop in order for the component to update, otherwise the user's change will be reverted immediately to reflect `props.date` as the source of truth.
+
+### Example
+
+
+
+
+```SnackPlayer name=DatePickerIOS&supportedPlatforms=ios
+import React, {useState} from 'react';
+import {DatePickerIOS, View, StyleSheet} from 'react-native';
+
+const App = () => {
+
+ const [chosenDate, setChosenDate] = useState(new Date());
+
+ return (
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ },
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=DatePickerIOS&supportedPlatforms=ios
+import React, {Component} from 'react';
+import {DatePickerIOS, View, StyleSheet} from 'react-native';
+
+export default class App extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {chosenDate: new Date()};
+
+ this.setDate = this.setDate.bind(this);
+ }
+
+ setDate(newDate) {
+ this.setState({chosenDate: newDate});
+ }
+
+ render() {
+ return (
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ },
+});
+```
+
+
+
+
+---
+
+# Reference
+
+## Props
+
+Inherits [View Props](view.md#props).
+
+### `date`
+
+The currently selected date.
+
+| Type | Required |
+| ---- | -------- |
+| Date | Yes |
+
+---
+
+### `onChange`
+
+Date change handler.
+
+This is called when the user changes the date or time in the UI. The first and only argument is an Event. For getting the date the picker was changed to, use onDateChange instead.
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `onDateChange`
+
+Date change handler.
+
+This is called when the user changes the date or time in the UI. The first and only argument is a Date object representing the new date and time.
+
+| Type | Required |
+| -------- | -------- |
+| function | Yes |
+
+---
+
+### `maximumDate`
+
+Maximum date.
+
+Restricts the range of possible date/time values.
+
+| Type | Required |
+| ---- | -------- |
+| Date | No |
+
+Example with `maximumDate` set to December 31, 2017:
+
+
+
+---
+
+### `minimumDate`
+
+Minimum date.
+
+Restricts the range of possible date/time values.
+
+| Type | Required |
+| ---- | -------- |
+| Date | No |
+
+See [`maximumDate`](#maximumdate) for an example image.
+
+---
+
+### `minuteInterval`
+
+The interval at which minutes can be selected.
+
+| Type | Required |
+| ------------------------------------------ | -------- |
+| enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) | No |
+
+Example with `minuteInterval` set to `10`:
+
+
+
+---
+
+### `mode`
+
+The date picker mode.
+
+| Type | Required |
+| --------------------------------------------- | -------- |
+| enum('date', 'time', 'datetime', 'countdown') | No |
+
+Example with `mode` set to `date`, `time`, and `datetime`: 
+
+---
+
+### `locale`
+
+The locale for the date picker. Value needs to be a [Locale ID](https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html).
+
+| Type | Required |
+| ------ | -------- |
+| String | No |
+
+---
+
+### `timeZoneOffsetInMinutes`
+
+Timezone offset in minutes.
+
+By default, the date picker will use the device's timezone. With this parameter, it is possible to force a certain timezone offset. For instance, to show times in Pacific Standard Time, pass -7 \* 60.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `initialDate`
+
+Provides an initial value that will change when the user starts selecting a date. It is useful for use-cases where you do not want to deal with listening to events and updating the date prop to keep the controlled state in sync. The controlled state has known bugs which causes it to go out of sync with native. The initialDate prop is intended to allow you to have native be source of truth.
+
+| Type | Required |
+| ---- | -------- |
+| Date | No |
diff --git a/website/versioned_docs/version-0.70/debugging.md b/website/versioned_docs/version-0.70/debugging.md
new file mode 100644
index 00000000000..1aac31a688c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/debugging.md
@@ -0,0 +1,202 @@
+---
+id: debugging
+title: Debugging
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+## Accessing the In-App Developer Menu
+
+You can access the developer menu by shaking your device or by selecting "Shake Gesture" inside the Hardware menu in the iOS Simulator. You can also use the `⌘D` keyboard shortcut when your app is running in the iOS Simulator, or `⌘M` when running in an Android emulator on macOS and `Ctrl+M` on Windows and Linux. Alternatively for Android, you can run the command `adb shell input keyevent 82` to open the dev menu (82 being the Menu key code).
+
+
+
+> The Developer Menu is disabled in release (production) builds.
+
+## Enabling Fast Refresh
+
+Fast Refresh is a React Native feature that allows you to get near-instant feedback for changes in your React components. While debugging, it can help to have [Fast Refresh](fast-refresh.md) enabled. Fast Refresh is enabled by default, and you can toggle "Enable Fast Refresh" in the React Native developer menu. When enabled, most of your edits should be visible within a second or two.
+
+## Enabling Keyboard Shortcuts
+
+React Native supports a few keyboard shortcuts in the iOS Simulator. They are described below. To enable them on macOS, inside the Simulator app, open the I/O menu, select Keyboard, and make sure that "Connect Hardware Keyboard" is checked.
+
+## LogBox
+
+Errors and warnings in development builds are displayed in LogBox inside your app.
+
+> LogBox is automatically disabled in release (production) builds.
+
+### Console Errors and Warnings
+
+Console errors and warnings are displayed as on-screen notifications with a red or yellow badge, and the number of errors or warning in the console respectively. To view a console error or warnings, tap the notification to view the full screen information about the log and to paginate through all of the logs in the console.
+
+These notifications can be hidden using `LogBox.ignoreAllLogs()`. This is useful when giving product demos, for example. Additionally, notifications can be hidden on a per-log basis via `LogBox.ignoreLogs()`. This is useful when there's a noisy warning that cannot be fixed, like those in a third-party dependency.
+
+> Ignore logs as a last resort and create a task to fix any logs that are ignored.
+
+```jsx
+import { LogBox } from 'react-native';
+
+// Ignore log notification by message:
+LogBox.ignoreLogs(['Warning: ...']);
+
+// Ignore all log notifications:
+LogBox.ignoreAllLogs();
+```
+
+### Unhandled Errors
+
+Unhandled JavaScript errors such as `undefined is not a function` will automatically open a full screen LogBox error with the source of the error. These errors are dismissable and minimizable so that you can see the state of your app when these errors occur, but should always be addressed.
+
+### Syntax Errors
+
+When syntax error occurs the full screen LogBox error will automatically open with the stack trace and location of the syntax error. This error is not dismissable because it represents invalid JavaScript execution that must be fixed before continuing with your app. To dismiss these errors, fix the syntax error and either save to automatically dismiss (with Fast Refresh enabled) or cmd+r to reload (with Fast Refresh disabled).
+
+## Chrome Developer Tools
+
+To debug the JavaScript code in Chrome, select "Debug JS Remotely" from the Developer Menu. This will open a new tab at [http://localhost:8081/debugger-ui](http://localhost:8081/debugger-ui).
+
+Select `Tools → Developer Tools` from the Chrome Menu to open the [Developer Tools](https://developer.chrome.com/devtools). You may also access the DevTools using keyboard shortcuts (`⌘⌥I` on macOS, `Ctrl` `Shift` `I` on Windows). You may also want to enable [Pause On Caught Exceptions](http://stackoverflow.com/questions/2233339/javascript-is-there-a-way-to-get-chrome-to-break-on-all-errors/17324511#17324511) for a better debugging experience.
+
+> Note: on Android, if the times between the debugger and device have drifted; things such as animation, event behavior, etc., might not work properly or the results may not be accurate. Please correct this by running `` adb shell "date `date +%m%d%H%M%Y.%S%3N`" `` on your debugger machine. Root access is required for the use in real device.
+
+> Note: the React Developer Tools Chrome extension does not work with React Native, but you can use its standalone version instead. Read [this section](debugging.md#react-developer-tools) to learn how.
+
+### Debugging using a custom JavaScript debugger
+
+To use a custom JavaScript debugger in place of Chrome Developer Tools, set the `REACT_DEBUGGER` environment variable to a command that will start your custom debugger. You can then select "Debug JS Remotely" from the Developer Menu to start debugging.
+
+The debugger will receive a list of all project roots, separated by a space. For example, if you set `REACT_DEBUGGER="node /path/to/launchDebugger.js --port 2345 --type ReactNative"`, then the command `node /path/to/launchDebugger.js --port 2345 --type ReactNative /path/to/reactNative/app` will be used to start your debugger.
+
+> Custom debugger commands executed this way should be short-lived processes, and they shouldn't produce more than 200 kilobytes of output.
+
+## Safari Developer Tools
+
+You can use Safari to debug the iOS version of your app without having to enable "Debug JS Remotely".
+
+- On a physical device go to: `Settings → Safari → Advanced → Make sure "Web Inspector" is turned on` (This step is not needed on the Simulator)
+- On your Mac enable Develop menu in Safari: `Preferences → Advanced → Select "Show Develop menu in menu bar"`
+- Select your app's JSContext: `Develop → Simulator (or other device) → JSContext`
+- Safari's Web Inspector should open which has a Console and a Debugger
+
+While sourcemaps may not be enabled by default, you can follow [this guide](http://blog.nparashuram.com/2019/10/debugging-react-native-ios-apps-with.html) or [video](https://www.youtube.com/watch?v=GrGqIIz51k4) to enable them and set break points at the right places in the source code.
+
+However, every time the app is reloaded (using live reload, or by manually reloading), a new JSContext is created. Choosing "Automatically Show Web Inspectors for JSContexts" saves you from having to select the latest JSContext manually.
+
+## React Developer Tools
+
+You can use [the standalone version of React Developer Tools](https://github.com/facebook/react/tree/main/packages/react-devtools) to debug the React component hierarchy. To use it, install the `react-devtools` package globally:
+
+> Note: Version 4 of `react-devtools` requires `react-native` version 0.62 or higher to work properly.
+
+
+
+
+```shell
+npm install -g react-devtools
+```
+
+
+
+
+```shell
+yarn global add react-devtools
+```
+
+
+
+
+Now run `react-devtools` from the terminal to launch the standalone DevTools app:
+
+```shell
+react-devtools
+```
+
+
+
+It should connect to your simulator within a few seconds.
+
+:::info
+If connecting to the emulator proves troublesome (especially Android 12), try running `adb reverse tcp:8097 tcp:8097` in a new terminal.
+:::
+
+:::info
+If you prefer to avoid global installations, you can add `react-devtools` as a project dependency. Add the `react-devtools` package to your project using `npm install --save-dev react-devtools`, then add `"react-devtools": "react-devtools"` to the `scripts` section in your `package.json`, and then run `npm run react-devtools` from your project folder to open the DevTools.
+:::
+
+### Integration with React Native Inspector
+
+Open the in-app developer menu and choose "Toggle Inspector". It will bring up an overlay that lets you tap on any UI element and see information about it:
+
+
+
+However, when `react-devtools` is running, Inspector will enter a collapsed mode, and instead use the DevTools as primary UI. In this mode, clicking on something in the simulator will bring up the relevant components in the DevTools:
+
+
+
+You can choose "Toggle Inspector" in the same menu to exit this mode.
+
+### Inspecting Component Instances
+
+When debugging JavaScript in Chrome, you can inspect the props and state of the React components in the browser console.
+
+First, follow the instructions for debugging in Chrome to open the Chrome console.
+
+Make sure that the dropdown in the top left corner of the Chrome console says `debuggerWorker.js`. **This step is essential.**
+
+Then select a React component in React DevTools. There is a search box at the top that helps you find one by name. As soon as you select it, it will be available as `$r` in the Chrome console, letting you inspect its props, state, and instance properties.
+
+
+
+## Performance Monitor
+
+You can enable a performance overlay to help you debug performance problems by selecting "Perf Monitor" in the Developer Menu.
+
+
+
+## Debugging Application State
+
+[Reactotron](https://github.com/infinitered/reactotron) is an open-source desktop app that allows you to inspect Redux or MobX-State-Tree application state as well as view custom logs, run custom commands such as resetting state, store and restore state snapshots, and other helpful debugging features for React Native apps.
+
+You can view installation instructions [in the README](https://github.com/infinitered/reactotron). If you're using Expo, here is an article detailing [how to install on Expo](https://shift.infinite.red/start-using-reactotron-in-your-expo-project-today-in-3-easy-steps-a03d11032a7a).
+
+# Native Debugging
+
+
+
Projects with Native Code Only
+
+ The following section only applies to projects with native code exposed. If you are using the managed Expo workflow, see the guide on prebuild to use this API.
+
+
+
+## Accessing console logs
+
+You can display the console logs for an iOS or Android app by using the following commands in a terminal while the app is running:
+
+```shell
+npx react-native log-ios
+npx react-native log-android
+```
+
+You may also access these through `Debug → Open System Log...` in the iOS Simulator or by running `adb logcat *:S ReactNative:V ReactNativeJS:V` in a terminal while an Android app is running on a device or emulator.
+
+> If you're using Create React Native App or Expo CLI, console logs already appear in the same terminal output as the bundler.
+
+## Debugging on a device with Chrome Developer Tools
+
+> If you're using Create React Native App or Expo CLI, this is configured for you already.
+
+On iOS devices, open the file [`RCTWebSocketExecutor.mm`](https://github.com/facebook/react-native/blob/master/React/CoreModules/RCTWebSocketExecutor.mm) and change "localhost" to the IP address of your computer, then select "Debug JS Remotely" from the Developer Menu.
+
+On Android 5.0+ devices connected via USB, you can use the [`adb` command line tool](http://developer.android.com/tools/help/adb.html) to setup port forwarding from the device to your computer:
+
+`adb reverse tcp:8081 tcp:8081`
+
+Alternatively, select "Dev Settings" from the Developer Menu, then update the "Debug server host for device" setting to match the IP address of your computer.
+
+> If you run into any issues, it may be possible that one of your Chrome extensions is interacting in unexpected ways with the debugger. Try disabling all of your extensions and re-enabling them one-by-one until you find the problematic extension.
+
+## Debugging native code
+
+When working with native code, such as when writing native modules, you can launch the app from Android Studio or Xcode and take advantage of the native debugging features (setting up breakpoints, etc.) as you would in case of building a standard native app.
diff --git a/website/versioned_docs/version-0.70/devsettings.md b/website/versioned_docs/version-0.70/devsettings.md
new file mode 100644
index 00000000000..1c46f3bcd8f
--- /dev/null
+++ b/website/versioned_docs/version-0.70/devsettings.md
@@ -0,0 +1,51 @@
+---
+id: devsettings
+title: DevSettings
+---
+
+The `DevSettings` module exposes methods for customizing settings for developers in development.
+
+---
+
+# Reference
+
+## Methods
+
+### `addMenuItem()`
+
+```jsx
+static addMenuItem(title, handler)
+```
+
+Add a custom menu item to the developer menu.
+
+**Parameters:**
+
+| Name | Type |
+| ------------------------------------------------------------ | -------- |
+| title
Required
| string |
+| handler
Required
| function |
+
+**Example:**
+
+```jsx
+DevSettings.addMenuItem('Show Secret Dev Screen', () => {
+ Alert.alert('Showing secret dev screen!');
+});
+```
+
+---
+
+### `reload()`
+
+```jsx
+static reload()
+```
+
+Reload the application. Can be invoked directly or on user interaction.
+
+**Example:**
+
+```jsx
+ DevSettings.reload()} />
+```
diff --git a/website/versioned_docs/version-0.70/dimensions.md b/website/versioned_docs/version-0.70/dimensions.md
new file mode 100644
index 00000000000..874ffdba5e3
--- /dev/null
+++ b/website/versioned_docs/version-0.70/dimensions.md
@@ -0,0 +1,231 @@
+---
+id: dimensions
+title: Dimensions
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+> [`useWindowDimensions`](usewindowdimensions) is the preferred API for React components. Unlike `Dimensions`, it updates as the window's dimensions update. This works nicely with the React paradigm.
+
+```jsx
+import { Dimensions } from 'react-native';
+```
+
+You can get the application window's width and height using the following code:
+
+```jsx
+const windowWidth = Dimensions.get('window').width;
+const windowHeight = Dimensions.get('window').height;
+```
+
+> Although dimensions are available immediately, they may change (e.g due to device rotation, foldable devices etc) so any rendering logic or styles that depend on these constants should try to call this function on every render, rather than caching the value (for example, using inline styles rather than setting a value in a `StyleSheet`).
+
+If you are targeting foldable devices or devices which can change the screen size or app window size, you can use the event listener available in the Dimensions module as shown in the below example.
+
+## Example
+
+
+
+
+```SnackPlayer name=Dimensions
+import React, { useState, useEffect } from "react";
+import { View, StyleSheet, Text, Dimensions } from "react-native";
+
+const window = Dimensions.get("window");
+const screen = Dimensions.get("screen");
+
+const App = () => {
+ const [dimensions, setDimensions] = useState({ window, screen });
+
+ useEffect(() => {
+ const subscription = Dimensions.addEventListener(
+ "change",
+ ({ window, screen }) => {
+ setDimensions({ window, screen });
+ }
+ );
+ return () => subscription?.remove();
+ });
+
+ return (
+
+ Window Dimensions
+ {Object.entries(dimensions.window).map(([key, value]) => (
+ {key} - {value}
+ ))}
+ Screen Dimensions
+ {Object.entries(dimensions.screen).map(([key, value]) => (
+ {key} - {value}
+ ))}
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center"
+ },
+ header: {
+ fontSize: 16,
+ marginVertical: 10
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=Dimensions
+import React, { Component } from "react";
+import { View, StyleSheet, Text, Dimensions } from "react-native";
+
+const window = Dimensions.get("window");
+const screen = Dimensions.get("screen");
+
+class App extends Component {
+ state = {
+ dimensions: {
+ window,
+ screen
+ }
+ };
+
+ onChange = ({ window, screen }) => {
+ this.setState({ dimensions: { window, screen } });
+ };
+
+ componentDidMount() {
+ this.dimensionsSubscription = Dimensions.addEventListener("change", this.onChange);
+ }
+
+ componentWillUnmount() {
+ this.dimensionsSubscription?.remove();
+ }
+
+ render() {
+ const { dimensions: { window, screen } } = this.state;
+
+ return (
+
+ Window Dimensions
+ {Object.entries(window).map(([key, value]) => (
+ {key} - {value}
+ ))}
+ Screen Dimensions
+ {Object.entries(screen).map(([key, value]) => (
+ {key} - {value}
+ ))}
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center"
+ },
+ header: {
+ fontSize: 16,
+ marginVertical: 10
+ }
+});
+
+export default App;
+```
+
+
+
+
+# Reference
+
+## Methods
+
+### `addEventListener()`
+
+```jsx
+static addEventListener(type, handler)
+```
+
+Add an event handler. Supported events:
+
+- `change`: Fires when a property within the `Dimensions` object changes. The argument to the event handler is a [`DimensionsValue`](#dimensionsvalue) type object.
+
+---
+
+### `get()`
+
+```jsx
+static get(dim)
+```
+
+Initial dimensions are set before `runApplication` is called so they should be available before any other require's are run, but may be updated later.
+
+Example: `const {height, width} = Dimensions.get('window');`
+
+**Parameters:**
+
+| Name | Type | Description |
+| ------------------------------------------------------------------ | ------ | --------------------------------------------------------------------------------- |
+| dim
Required
| string | Name of dimension as defined when calling `set`. Returns value for the dimension. |
+
+> For Android the `window` dimension will exclude the size used by the `status bar` (if not translucent) and `bottom navigation bar`
+
+---
+
+### `removeEventListener()`
+
+```jsx
+static removeEventListener(type, handler)
+```
+
+> **Deprecated.** Use the `remove()` method on the event subscription returned by [`addEventListener()`](#addeventlistener).
+
+---
+
+### `set()`
+
+```jsx
+static set(dims)
+```
+
+This should only be called from native code by sending the `didUpdateDimensions` event.
+
+**Parameters:**
+
+| Name | Type | Description |
+| --------------------------------------------------------- | ------ | ----------------------------------------- |
+| dims
Required
| object | String-keyed object of dimensions to set. |
+
+---
+
+## Type Definitions
+
+### DimensionsValue
+
+**Properties:**
+
+| Name | Type | Description |
+| ------ | ------------------------------------------- | --------------------------------------- |
+| window | [DisplayMetrics](dimensions#displaymetrics) | Size of the visible Application window. |
+| screen | [DisplayMetrics](dimensions#displaymetrics) | Size of the device's screen. |
+
+### DisplayMetrics
+
+| Type |
+| ------ |
+| object |
+
+**Properties:**
+
+| Name | Type |
+| --------- | ------ |
+| width | number |
+| height | number |
+| scale | number |
+| fontScale | number |
diff --git a/website/versioned_docs/version-0.70/direct-manipulation.md b/website/versioned_docs/version-0.70/direct-manipulation.md
new file mode 100644
index 00000000000..3a711b81c99
--- /dev/null
+++ b/website/versioned_docs/version-0.70/direct-manipulation.md
@@ -0,0 +1,264 @@
+---
+id: direct-manipulation
+title: Direct Manipulation
+---
+
+import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
+
+
+
+It is sometimes necessary to make changes directly to a component without using state/props to trigger a re-render of the entire subtree. When using React in the browser for example, you sometimes need to directly modify a DOM node, and the same is true for views in mobile apps. `setNativeProps` is the React Native equivalent to setting properties directly on a DOM node.
+
+:::caution
+Use `setNativeProps` when frequent re-rendering creates a performance bottleneck!
+
+Direct manipulation will not be a tool that you reach for frequently. You will typically only be using it for creating continuous animations to avoid the overhead of rendering the component hierarchy and reconciling many views.
+`setNativeProps` is imperative and stores state in the native layer (DOM, UIView, etc.) and not within your React components, which makes your code more difficult to reason about.
+
+Before you use it, try to solve your problem with `setState` and [`shouldComponentUpdate`](https://reactjs.org/docs/optimizing-performance.html#shouldcomponentupdate-in-action).
+:::
+
+## setNativeProps with TouchableOpacity
+
+[TouchableOpacity](https://github.com/facebook/react-native/blob/master/Libraries/Components/Touchable/TouchableOpacity.js) uses `setNativeProps` internally to update the opacity of its child component:
+
+```jsx
+const viewRef = useRef();
+const setOpacityTo = useCallback((value) => {
+ // Redacted: animation related code
+ viewRef.current.setNativeProps({
+ opacity: value
+ });
+}, []);
+```
+
+This allows us to write the following code and know that the child will have its opacity updated in response to taps, without the child having any knowledge of that fact or requiring any changes to its implementation:
+
+```jsx
+
+
+ Press me!
+
+
+```
+
+Let's imagine that `setNativeProps` was not available. One way that we might implement it with that constraint is to store the opacity value in the state, then update that value whenever `onPress` is fired:
+
+```jsx
+const [buttonOpacity, setButtonOpacity] = useState(1);
+return (
+ setButtonOpacity(0.5)}
+ onPressOut={() => setButtonOpacity(1)}>
+
+ Press me!
+
+
+);
+```
+
+This is computationally intensive compared to the original example - React needs to re-render the component hierarchy each time the opacity changes, even though other properties of the view and its children haven't changed. Usually this overhead isn't a concern but when performing continuous animations and responding to gestures, judiciously optimizing your components can improve your animations' fidelity.
+
+If you look at the implementation of `setNativeProps` in [NativeMethodsMixin](https://github.com/facebook/react-native/blob/master/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js) you will notice that it is a wrapper around `RCTUIManager.updateView` - this is the exact same function call that results from re-rendering - see [receiveComponent in ReactNativeBaseComponent](https://github.com/facebook/react-native/blob/fb2ec1ea47c53c2e7b873acb1cb46192ac74274e/Libraries/Renderer/oss/ReactNativeRenderer-prod.js#L5793-L5813).
+
+## Composite components and setNativeProps
+
+Composite components are not backed by a native view, so you cannot call `setNativeProps` on them. Consider this example:
+
+```SnackPlayer name=setNativeProps%20with%20Composite%20Components
+import React from "react";
+import { Text, TouchableOpacity, View } from "react-native";
+
+const MyButton = (props) => (
+
+ {props.label}
+
+);
+
+export default App = () => (
+
+
+
+);
+```
+
+If you run this you will immediately see this error: `Touchable child must either be native or forward setNativeProps to a native component`. This occurs because `MyButton` isn't directly backed by a native view whose opacity should be set. You can think about it like this: if you define a component with `createReactClass` you would not expect to be able to set a style prop on it and have that work - you would need to pass the style prop down to a child, unless you are wrapping a native component. Similarly, we are going to forward `setNativeProps` to a native-backed child component.
+
+#### Forward setNativeProps to a child
+
+Since the `setNativeProps` method exists on any ref to a `View` component, it is enough to forward a ref on your custom component to one of the `` components that it renders. This means that a call to `setNativeProps` on the custom component will have the same effect as if you called `setNativeProps` on the wrapped `View` component itself.
+
+```SnackPlayer name=Forwarding%20setNativeProps
+import React from "react";
+import { Text, TouchableOpacity, View } from "react-native";
+
+const MyButton = React.forwardRef((props, ref) => (
+
+ {props.label}
+
+));
+
+export default App = () => (
+
+
+
+);
+```
+
+You can now use `MyButton` inside of `TouchableOpacity`!
+
+You may have noticed that we passed all of the props down to the child view using `{...props}`. The reason for this is that `TouchableOpacity` is actually a composite component, and so in addition to depending on `setNativeProps` on its child, it also requires that the child perform touch handling. To do this, it passes on [various props](view.md#onmoveshouldsetresponder) that call back to the `TouchableOpacity` component. `TouchableHighlight`, in contrast, is backed by a native view and only requires that we implement `setNativeProps`.
+
+## setNativeProps to edit TextInput value
+
+Another very common use case of `setNativeProps` is to edit the value of the TextInput. The `controlled` prop of TextInput can sometimes drop characters when the `bufferDelay` is low and the user types very quickly. Some developers prefer to skip this prop entirely and instead use `setNativeProps` to directly manipulate the TextInput value when necessary. For example, the following code demonstrates editing the input when you tap a button:
+
+```SnackPlayer name=Clear%20text
+import React from "react";
+import { useCallback, useRef } from "react";
+import { StyleSheet, TextInput, Text, TouchableOpacity, View } from "react-native";
+
+const App = () => {
+ const inputRef = useRef();
+ const editText = useCallback(() => {
+ inputRef.current.setNativeProps({ text: "Edited Text" });
+ }, []);
+
+ return (
+
+
+
+ Edit text
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center",
+ },
+ input: {
+ height: 50,
+ width: 200,
+ marginHorizontal: 20,
+ borderWidth: 1,
+ borderColor: "#ccc",
+ },
+});
+
+export default App;
+```
+
+You can use the [`clear`](textinput#clear) method to clear the `TextInput` which clears the current input text using the same approach.
+
+## Avoiding conflicts with the render function
+
+If you update a property that is also managed by the render function, you might end up with some unpredictable and confusing bugs because anytime the component re-renders and that property changes, whatever value was previously set from `setNativeProps` will be completely ignored and overridden.
+
+## setNativeProps & shouldComponentUpdate
+
+By [intelligently applying `shouldComponentUpdate`](https://reactjs.org/docs/optimizing-performance.html#avoid-reconciliation) you can avoid the unnecessary overhead involved in reconciling unchanged component subtrees, to the point where it may be performant enough to use `setState` instead of `setNativeProps`.
+
+## Other native methods
+
+The methods described here are available on most of the default components provided by React Native. Note, however, that they are _not_ available on composite components that aren't directly backed by a native view. This will generally include most components that you define in your own app.
+
+### measure(callback)
+
+Determines the location on screen, width, and height in the viewport of the given view and returns the values via an async callback. If successful, the callback will be called with the following arguments:
+
+- x
+- y
+- width
+- height
+- pageX
+- pageY
+
+Note that these measurements are not available until after the rendering has been completed in native. If you need the measurements as soon as possible and you don't need `pageX` and `pageY`, consider using the [`onLayout`](view.md#onlayout) property instead.
+
+Also the width and height returned by `measure()` are the width and height of the component in the viewport. If you need the actual size of the component, consider using the [`onLayout`](view.md#onlayout) property instead.
+
+### measureInWindow(callback)
+
+Determines the location of the given view in the window and returns the values via an async callback. If the React root view is embedded in another native view, this will give you the absolute coordinates. If successful, the callback will be called with the following arguments:
+
+- x
+- y
+- width
+- height
+
+### measureLayout(relativeToNativeComponentRef, onSuccess, onFail)
+
+Like `measure()`, but measures the view relative to an ancestor, specified with `relativeToNativeComponentRef` reference. This means that the returned coordinates are relative to the origin `x`, `y` of the ancestor view.
+
+:::note
+This method can also be called with a `relativeToNativeNode` handler (instead of reference), but this variant is deprecated.
+:::
+
+```SnackPlayer name=measureLayout%20example&supportedPlatforms=android,ios
+import React, { useEffect, useRef, useState } from "react";
+import { Text, View, StyleSheet } from "react-native";
+
+const App = () => {
+ const textContainerRef = useRef(null);
+ const textRef = useRef(null);
+ const [measure, setMeasure] = useState(null);
+
+ useEffect(() => {
+ if (textRef.current && textContainerRef.current) {
+ textRef.current.measureLayout(
+ textContainerRef.current,
+ (left, top, width, height) => {
+ setMeasure({ left, top, width, height });
+ }
+ );
+ }
+ }, [measure]);
+
+ return (
+
+
+
+ Where am I? (relative to the text container)
+
+
+
+ {JSON.stringify(measure)}
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ },
+ textContainer: {
+ backgroundColor: "#61dafb",
+ justifyContent: "center",
+ alignItems: "center",
+ padding: 12,
+ },
+ measure: {
+ textAlign: "center",
+ padding: 12,
+ },
+});
+
+export default App;
+```
+
+### focus()
+
+Requests focus for the given input or view. The exact behavior triggered will depend on the platform and type of view.
+
+### blur()
+
+Removes focus from an input or view. This is the opposite of `focus()`.
diff --git a/website/versioned_docs/version-0.70/drawerlayoutandroid.md b/website/versioned_docs/version-0.70/drawerlayoutandroid.md
new file mode 100644
index 00000000000..4a64f3e158e
--- /dev/null
+++ b/website/versioned_docs/version-0.70/drawerlayoutandroid.md
@@ -0,0 +1,237 @@
+---
+id: drawerlayoutandroid
+title: DrawerLayoutAndroid
+---
+
+React component that wraps the platform `DrawerLayout` (Android only). The Drawer (typically used for navigation) is rendered with `renderNavigationView` and direct children are the main view (where your content goes). The navigation view is initially not visible on the screen, but can be pulled in from the side of the window specified by the `drawerPosition` prop and its width can be set by the `drawerWidth` prop.
+
+## Example
+
+```SnackPlayer name=DrawerLayoutAndroid%20Component%20Example&supportedPlatforms=android
+import React, { useRef, useState } from "react";
+import { Button, DrawerLayoutAndroid, Text, StyleSheet, View } from "react-native";
+
+const App = () => {
+ const drawer = useRef(null);
+ const [drawerPosition, setDrawerPosition] = useState("left");
+ const changeDrawerPosition = () => {
+ if (drawerPosition === "left") {
+ setDrawerPosition("right");
+ } else {
+ setDrawerPosition("left");
+ }
+ };
+
+ const navigationView = () => (
+
+ I'm in the Drawer!
+ drawer.current.closeDrawer()}
+ />
+
+ );
+
+ return (
+
+
+
+ Drawer on the {drawerPosition}!
+
+ changeDrawerPosition()}
+ />
+
+ Swipe from the side or press button below to see it!
+
+ drawer.current.openDrawer()}
+ />
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "center",
+ justifyContent: "center",
+ padding: 16
+ },
+ navigationContainer: {
+ backgroundColor: "#ecf0f1"
+ },
+ paragraph: {
+ padding: 16,
+ fontSize: 15,
+ textAlign: "center"
+ }
+});
+
+export default App;
+```
+
+---
+
+# Reference
+
+## Props
+
+### [View Props](view.md#props)
+
+Inherits [View Props](view.md#props).
+
+---
+
+### `drawerBackgroundColor`
+
+Specifies the background color of the drawer. The default value is `white`. If you want to set the opacity of the drawer, use rgba. Example:
+
+```jsx
+return (
+
+);
+```
+
+| Type | Required |
+| ------------------ | -------- |
+| [color](colors.md) | No |
+
+---
+
+### `drawerLockMode`
+
+Specifies the lock mode of the drawer. The drawer can be locked in 3 states:
+
+- unlocked (default), meaning that the drawer will respond (open/close) to touch gestures.
+- locked-closed, meaning that the drawer will stay closed and not respond to gestures.
+- locked-open, meaning that the drawer will stay opened and not respond to gestures. The drawer may still be opened and closed programmatically (`openDrawer`/`closeDrawer`).
+
+| Type | Required |
+| ------------------------------------------------ | -------- |
+| enum('unlocked', 'locked-closed', 'locked-open') | No |
+
+---
+
+### `drawerPosition`
+
+Specifies the side of the screen from which the drawer will slide in. By default it is set to `left`.
+
+| Type | Required |
+| --------------------- | -------- |
+| enum('left', 'right') | No |
+
+---
+
+### `drawerWidth`
+
+Specifies the width of the drawer, more precisely the width of the view that be pulled in from the edge of the window.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `keyboardDismissMode`
+
+Determines whether the keyboard gets dismissed in response to a drag.
+
+- 'none' (the default), drags do not dismiss the keyboard.
+- 'on-drag', the keyboard is dismissed when a drag begins.
+
+| Type | Required |
+| ----------------------- | -------- |
+| enum('none', 'on-drag') | No |
+
+---
+
+### `onDrawerClose`
+
+Function called whenever the navigation view has been closed.
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `onDrawerOpen`
+
+Function called whenever the navigation view has been opened.
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `onDrawerSlide`
+
+Function called whenever there is an interaction with the navigation view.
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `onDrawerStateChanged`
+
+Function called when the drawer state has changed. The drawer can be in 3 states:
+
+- idle, meaning there is no interaction with the navigation view happening at the time
+- dragging, meaning there is currently an interaction with the navigation view
+- settling, meaning that there was an interaction with the navigation view, and the navigation view is now finishing its closing or opening animation
+
+| Type | Required |
+| -------- | -------- |
+| function | No |
+
+---
+
+### `renderNavigationView`
+
+The navigation view that will be rendered to the side of the screen and can be pulled in.
+
+| Type | Required |
+| -------- | -------- |
+| function | Yes |
+
+---
+
+### `statusBarBackgroundColor`
+
+Make the drawer take the entire screen and draw the background of the status bar to allow it to open over the status bar. It will only have an effect on API 21+.
+
+| Type | Required |
+| ------------------ | -------- |
+| [color](colors.md) | No |
+
+## Methods
+
+### `closeDrawer()`
+
+```jsx
+closeDrawer();
+```
+
+Closes the drawer.
+
+---
+
+### `openDrawer()`
+
+```jsx
+openDrawer();
+```
+
+Opens the drawer.
diff --git a/website/versioned_docs/version-0.70/dynamiccolorios.md b/website/versioned_docs/version-0.70/dynamiccolorios.md
new file mode 100644
index 00000000000..946cb865359
--- /dev/null
+++ b/website/versioned_docs/version-0.70/dynamiccolorios.md
@@ -0,0 +1,55 @@
+---
+id: dynamiccolorios
+title: DynamicColorIOS
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+The `DynamicColorIOS` function is a platform color type specific to iOS.
+
+```jsx
+DynamicColorIOS({
+ light: color,
+ dark: color,
+ highContrastLight: color, // (optional) will fallback to "light" if not provided
+ highContrastDark: color // (optional) will fallback to "dark" if not provided
+});
+```
+
+`DynamicColorIOS` takes a single argument as an object with two mandatory keys: `dark` and `light`, and two optional keys `highContrastLight` and `highContrastDark`. These correspond to the colors you want to use for "light mode" and "dark mode" on iOS, and when high contrast accessibility mode is enabled, high contrast version of them.
+
+At runtime, the system will choose which of the colors to display depending on the current system appearance and accessibility settings. Dynamic colors are useful for branding colors or other app specific colors that still respond automatically to system setting changes.
+
+#### Developer notes
+
+
+
+
+
+> If you’re familiar with `@media (prefers-color-scheme: dark)` in CSS, this is similar! Only instead of defining all the colors in a media query, you define which color to use under what circumstances right there where you're using it. Neat!
+
+
+
+
+> The `DynamicColorIOS` function is similar to the iOS native methods [`UIColor colorWithDynamicProvider:`](https://developer.apple.com/documentation/uikit/uicolor/3238040-colorwithdynamicprovider)
+
+
+
+
+## Example
+
+```jsx
+import { DynamicColorIOS } from 'react-native';
+
+const customDynamicTextColor = DynamicColorIOS({
+ dark: 'lightskyblue',
+ light: 'midnightblue'
+});
+
+const customContrastDynamicTextColor = DynamicColorIOS({
+ dark: 'darkgray',
+ light: 'lightgray',
+ highContrastDark: 'black',
+ highContrastLight: 'white'
+});
+```
diff --git a/website/versioned_docs/version-0.70/easing.md b/website/versioned_docs/version-0.70/easing.md
new file mode 100644
index 00000000000..1615607e4b6
--- /dev/null
+++ b/website/versioned_docs/version-0.70/easing.md
@@ -0,0 +1,389 @@
+---
+id: easing
+title: Easing
+---
+
+The `Easing` module implements common easing functions. This module is used by [`Animated.timing()`](animated.md#timing) to convey physically believable motion in animations.
+
+You can find a visualization of some common easing functions at http://easings.net/
+
+### Predefined animations
+
+The `Easing` module provides several predefined animations through the following methods:
+
+- [`back`](easing.md#back) provides a basic animation where the object goes slightly back before moving forward
+- [`bounce`](easing.md#bounce) provides a bouncing animation
+- [`ease`](easing.md#ease) provides a basic inertial animation
+- [`elastic`](easing.md#elastic) provides a basic spring interaction
+
+### Standard functions
+
+Three standard easing functions are provided:
+
+- [`linear`](easing.md#linear)
+- [`quad`](easing.md#quad)
+- [`cubic`](easing.md#cubic)
+
+The [`poly`](easing.md#poly) function can be used to implement quartic, quintic, and other higher power functions.
+
+### Additional functions
+
+Additional mathematical functions are provided by the following methods:
+
+- [`bezier`](easing.md#bezier) provides a cubic bezier curve
+- [`circle`](easing.md#circle) provides a circular function
+- [`sin`](easing.md#sin) provides a sinusoidal function
+- [`exp`](easing.md#exp) provides an exponential function
+
+The following helpers are used to modify other easing functions.
+
+- [`in`](easing.md#in) runs an easing function forwards
+- [`inOut`](easing.md#inout) makes any easing function symmetrical
+- [`out`](easing.md#out) runs an easing function backwards
+
+## Example
+
+```SnackPlayer name=Easing%20Demo
+import React from "react";
+import { Animated, Easing, SectionList, StatusBar, StyleSheet, Text, TouchableOpacity, View } from "react-native";
+
+const App = () => {
+ let opacity = new Animated.Value(0);
+
+ const animate = easing => {
+ opacity.setValue(0);
+ Animated.timing(opacity, {
+ toValue: 1,
+ duration: 1200,
+ easing
+ }).start();
+ };
+
+ const size = opacity.interpolate({
+ inputRange: [0, 1],
+ outputRange: [0, 80]
+ });
+
+ const animatedStyles = [
+ styles.box,
+ {
+ opacity,
+ width: size,
+ height: size
+ }
+ ];
+
+ return (
+
+
+
+ Press rows below to preview the Easing!
+
+
+
+
+ item.title}
+ renderItem={({ item }) => (
+ animate(item.easing)}
+ style={styles.listRow}
+ >
+ {item.title}
+
+ )}
+ renderSectionHeader={({ section: { title } }) => (
+ {title}
+ )}
+ />
+
+ );
+};
+
+const SECTIONS = [
+ {
+ title: "Predefined animations",
+ data: [
+ { title: "Bounce", easing: Easing.bounce },
+ { title: "Ease", easing: Easing.ease },
+ { title: "Elastic", easing: Easing.elastic(4) }
+ ]
+ },
+ {
+ title: "Standard functions",
+ data: [
+ { title: "Linear", easing: Easing.linear },
+ { title: "Quad", easing: Easing.quad },
+ { title: "Cubic", easing: Easing.cubic }
+ ]
+ },
+ {
+ title: "Additional functions",
+ data: [
+ {
+ title: "Bezier",
+ easing: Easing.bezier(0, 2, 1, -1)
+ },
+ { title: "Circle", easing: Easing.circle },
+ { title: "Sin", easing: Easing.sin },
+ { title: "Exp", easing: Easing.exp }
+ ]
+ },
+ {
+ title: "Combinations",
+ data: [
+ {
+ title: "In + Bounce",
+ easing: Easing.in(Easing.bounce)
+ },
+ {
+ title: "Out + Exp",
+ easing: Easing.out(Easing.exp)
+ },
+ {
+ title: "InOut + Elastic",
+ easing: Easing.inOut(Easing.elastic(1))
+ }
+ ]
+ }
+];
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ backgroundColor: "#20232a"
+ },
+ title: {
+ marginTop: 10,
+ textAlign: "center",
+ color: "#61dafb"
+ },
+ boxContainer: {
+ height: 160,
+ alignItems: "center"
+ },
+ box: {
+ marginTop: 32,
+ borderRadius: 4,
+ backgroundColor: "#61dafb"
+ },
+ list: {
+ backgroundColor: "#fff"
+ },
+ listHeader: {
+ paddingHorizontal: 8,
+ paddingVertical: 4,
+ backgroundColor: "#f4f4f4",
+ color: "#999",
+ fontSize: 12,
+ textTransform: "uppercase"
+ },
+ listRow: {
+ padding: 8
+ }
+});
+
+export default App;
+```
+
+---
+
+# Reference
+
+## Methods
+
+### `step0()`
+
+```jsx
+static step0(n)
+```
+
+A stepping function, returns 1 for any positive value of `n`.
+
+---
+
+### `step1()`
+
+```jsx
+static step1(n)
+```
+
+A stepping function, returns 1 if `n` is greater than or equal to 1.
+
+---
+
+### `linear()`
+
+```jsx
+static linear(t)
+```
+
+A linear function, `f(t) = t`. Position correlates to elapsed time one to one.
+
+http://cubic-bezier.com/#0,0,1,1
+
+---
+
+### `ease()`
+
+```jsx
+static ease(t)
+```
+
+A basic inertial interaction, similar to an object slowly accelerating to speed.
+
+http://cubic-bezier.com/#.42,0,1,1
+
+---
+
+### `quad()`
+
+```jsx
+static quad(t)
+```
+
+A quadratic function, `f(t) = t * t`. Position equals the square of elapsed time.
+
+http://easings.net/#easeInQuad
+
+---
+
+### `cubic()`
+
+```jsx
+static cubic(t)
+```
+
+A cubic function, `f(t) = t * t * t`. Position equals the cube of elapsed time.
+
+http://easings.net/#easeInCubic
+
+---
+
+### `poly()`
+
+```jsx
+static poly(n)
+```
+
+A power function. Position is equal to the Nth power of elapsed time.
+
+n = 4: http://easings.net/#easeInQuart n = 5: http://easings.net/#easeInQuint
+
+---
+
+### `sin()`
+
+```jsx
+static sin(t)
+```
+
+A sinusoidal function.
+
+http://easings.net/#easeInSine
+
+---
+
+### `circle()`
+
+```jsx
+static circle(t)
+```
+
+A circular function.
+
+http://easings.net/#easeInCirc
+
+---
+
+### `exp()`
+
+```jsx
+static exp(t)
+```
+
+An exponential function.
+
+http://easings.net/#easeInExpo
+
+---
+
+### `elastic()`
+
+```jsx
+static elastic(bounciness)
+```
+
+A basic elastic interaction, similar to a spring oscillating back and forth.
+
+Default bounciness is 1, which overshoots a little bit once. 0 bounciness doesn't overshoot at all, and bounciness of N > 1 will overshoot about N times.
+
+http://easings.net/#easeInElastic
+
+---
+
+### `back()`
+
+```jsx
+static back(s)
+```
+
+Use with `Animated.parallel()` to create a basic effect where the object animates back slightly as the animation starts.
+
+---
+
+### `bounce()`
+
+```jsx
+static bounce(t)
+```
+
+Provides a basic bouncing effect.
+
+http://easings.net/#easeInBounce
+
+---
+
+### `bezier()`
+
+```jsx
+static bezier(x1, y1, x2, y2)
+```
+
+Provides a cubic bezier curve, equivalent to CSS Transitions' `transition-timing-function`.
+
+A useful tool to visualize cubic bezier curves can be found at http://cubic-bezier.com/
+
+---
+
+### `in()`
+
+
+```jsx
+static in(easing);
+```
+
+
+Runs an easing function forwards.
+
+---
+
+### `out()`
+
+```jsx
+static out(easing)
+```
+
+Runs an easing function backwards.
+
+---
+
+### `inOut()`
+
+```jsx
+static inOut(easing)
+```
+
+Makes any easing function symmetrical. The easing function will run forwards for half of the duration, then backwards for the rest of the duration.
diff --git a/website/versioned_docs/version-0.70/fast-refresh.md b/website/versioned_docs/version-0.70/fast-refresh.md
new file mode 100644
index 00000000000..a713c1fa8bd
--- /dev/null
+++ b/website/versioned_docs/version-0.70/fast-refresh.md
@@ -0,0 +1,47 @@
+---
+id: fast-refresh
+title: Fast Refresh
+---
+
+Fast Refresh is a React Native feature that allows you to get near-instant feedback for changes in your React components. Fast Refresh is enabled by default, and you can toggle "Enable Fast Refresh" in the [React Native developer menu](/docs/debugging#accessing-the-in-app-developer-menu). With Fast Refresh enabled, most edits should be visible within a second or two.
+
+## How It Works
+
+- If you edit a module that **only exports React component(s)**, Fast Refresh will update the code only for that module, and re-render your component. You can edit anything in that file, including styles, rendering logic, event handlers, or effects.
+- If you edit a module with exports that _aren't_ React components, Fast Refresh will re-run both that module, and the other modules importing it. So if both `Button.js` and `Modal.js` import `Theme.js`, editing `Theme.js` will update both components.
+- Finally, if you **edit a file** that's **imported by modules outside of the React tree**, Fast Refresh **will fall back to doing a full reload**. You might have a file which renders a React component but also exports a value that is imported by a **non-React component**. For example, maybe your component also exports a constant, and a non-React utility module imports it. In that case, consider migrating the constant to a separate file and importing it into both files. This will re-enable Fast Refresh to work. Other cases can usually be solved in a similar way.
+
+## Error Resilience
+
+If you make a **syntax error** during a Fast Refresh session, you can fix it and save the file again. The redbox will disappear. Modules with syntax errors are prevented from running, so you won't need to reload the app.
+
+If you make a **runtime error during the module initialization** (for example, typing `Style.create` instead of `StyleSheet.create`), the Fast Refresh session will continue once you fix the error. The redbox will disappear, and the module will be updated.
+
+If you make a mistake that leads to a **runtime error inside your component**, the Fast Refresh session will _also_ continue after you fix the error. In that case, React will remount your application using the updated code.
+
+If you have [error boundaries](https://reactjs.org/docs/error-boundaries.html) in your app (which is a good idea for graceful failures in production), they will retry rendering on the next edit after a redbox. In that sense, having an error boundary can prevent you from always getting kicked out to the root app screen. However, keep in mind that error boundaries shouldn't be _too_ granular. They are used by React in production, and should always be designed intentionally.
+
+## Limitations
+
+Fast Refresh tries to preserve local React state in the component you're editing, but only if it's safe to do so. Here's a few reasons why you might see local state being reset on every edit to a file:
+
+- Local state is not preserved for class components (only function components and Hooks preserve state).
+- The module you're editing might have _other_ exports in addition to a React component.
+- Sometimes, a module would export the result of calling higher-order component like `createNavigationContainer(MyScreen)`. If the returned component is a class, state will be reset.
+
+In the longer term, as more of your codebase moves to function components and Hooks, you can expect state to be preserved in more cases.
+
+## Tips
+
+- Fast Refresh preserves React local state in function components (and Hooks) by default.
+- Sometimes you might want to _force_ the state to be reset, and a component to be remounted. For example, this can be handy if you're tweaking an animation that only happens on mount. To do this, you can add `// @refresh reset` anywhere in the file you're editing. This directive is local to the file, and instructs Fast Refresh to remount components defined in that file on every edit.
+
+## Fast Refresh and Hooks
+
+When possible, Fast Refresh attempts to preserve the state of your component between edits. In particular, `useState` and `useRef` preserve their previous values as long as you don't change their arguments or the order of the Hook calls.
+
+Hooks with dependencies—such as `useEffect`, `useMemo`, and `useCallback`—will _always_ update during Fast Refresh. Their list of dependencies will be ignored while Fast Refresh is happening.
+
+For example, when you edit `useMemo(() => x * 2, [x])` to `useMemo(() => x * 10, [x])`, it will re-run even though `x` (the dependency) has not changed. If React didn't do that, your edit wouldn't reflect on the screen!
+
+Sometimes, this can lead to unexpected results. For example, even a `useEffect` with an empty array of dependencies would still re-run once during Fast Refresh. However, writing code resilient to an occasional re-running of `useEffect` is a good practice even without Fast Refresh. This makes it easier for you to later introduce new dependencies to it.
diff --git a/website/versioned_docs/version-0.70/flatlist.md b/website/versioned_docs/version-0.70/flatlist.md
new file mode 100644
index 00000000000..0398e1181c3
--- /dev/null
+++ b/website/versioned_docs/version-0.70/flatlist.md
@@ -0,0 +1,696 @@
+---
+id: flatlist
+title: FlatList
+---
+
+A performant interface for rendering basic, flat lists, supporting the most handy features:
+
+- Fully cross-platform.
+- Optional horizontal mode.
+- Configurable viewability callbacks.
+- Header support.
+- Footer support.
+- Separator support.
+- Pull to Refresh.
+- Scroll loading.
+- ScrollToIndex support.
+- Multiple column support.
+
+If you need section support, use [``](sectionlist.md).
+
+## Example
+
+```SnackPlayer name=flatlist-simple
+import React from 'react';
+import { SafeAreaView, View, FlatList, StyleSheet, Text, StatusBar } from 'react-native';
+
+const DATA = [
+ {
+ id: 'bd7acbea-c1b1-46c2-aed5-3ad53abb28ba',
+ title: 'First Item',
+ },
+ {
+ id: '3ac68afc-c605-48d3-a4f8-fbd91aa97f63',
+ title: 'Second Item',
+ },
+ {
+ id: '58694a0f-3da1-471f-bd96-145571e29d72',
+ title: 'Third Item',
+ },
+];
+
+const Item = ({ title }) => (
+
+ {title}
+
+);
+
+const App = () => {
+ const renderItem = ({ item }) => (
+
+ );
+
+ return (
+
+ item.id}
+ />
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: StatusBar.currentHeight || 0,
+ },
+ item: {
+ backgroundColor: '#f9c2ff',
+ padding: 20,
+ marginVertical: 8,
+ marginHorizontal: 16,
+ },
+ title: {
+ fontSize: 32,
+ },
+});
+
+export default App;
+```
+
+To render multiple columns, use the [`numColumns`](flatlist.md#numcolumns) prop. Using this approach instead of a `flexWrap` layout can prevent conflicts with the item height logic.
+
+More complex, selectable example below.
+
+- By passing `extraData={selectedId}` to `FlatList` we make sure `FlatList` itself will re-render when the state changes. Without setting this prop, `FlatList` would not know it needs to re-render any items because it is a `PureComponent` and the prop comparison will not show any changes.
+- `keyExtractor` tells the list to use the `id`s for the react keys instead of the default `key` property.
+
+```SnackPlayer name=flatlist-selectable
+import React, { useState } from "react";
+import { FlatList, SafeAreaView, StatusBar, StyleSheet, Text, TouchableOpacity } from "react-native";
+
+const DATA = [
+ {
+ id: "bd7acbea-c1b1-46c2-aed5-3ad53abb28ba",
+ title: "First Item",
+ },
+ {
+ id: "3ac68afc-c605-48d3-a4f8-fbd91aa97f63",
+ title: "Second Item",
+ },
+ {
+ id: "58694a0f-3da1-471f-bd96-145571e29d72",
+ title: "Third Item",
+ },
+];
+
+const Item = ({ item, onPress, backgroundColor, textColor }) => (
+
+ {item.title}
+
+);
+
+const App = () => {
+ const [selectedId, setSelectedId] = useState(null);
+
+ const renderItem = ({ item }) => {
+ const backgroundColor = item.id === selectedId ? "#6e3b6e" : "#f9c2ff";
+ const color = item.id === selectedId ? 'white' : 'black';
+
+ return (
+ setSelectedId(item.id)}
+ backgroundColor={{ backgroundColor }}
+ textColor={{ color }}
+ />
+ );
+ };
+
+ return (
+
+ item.id}
+ extraData={selectedId}
+ />
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: StatusBar.currentHeight || 0,
+ },
+ item: {
+ padding: 20,
+ marginVertical: 8,
+ marginHorizontal: 16,
+ },
+ title: {
+ fontSize: 32,
+ },
+});
+
+export default App;
+```
+
+This is a convenience wrapper around [``](virtualizedlist.md), and thus inherits its props (as well as those of [``](scrollview.md)) that aren't explicitly listed here, along with the following caveats:
+
+- Internal state is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item data or external stores like Flux, Redux, or Relay.
+- This is a `PureComponent` which means that it will not re-render if `props` remain shallow-equal. Make sure that everything your `renderItem` function depends on is passed as a prop (e.g. `extraData`) that is not `===` after updates, otherwise your UI may not update on changes. This includes the `data` prop and parent component state.
+- In order to constrain memory and enable smooth scrolling, content is rendered asynchronously offscreen. This means it's possible to scroll faster than the fill rate and momentarily see blank content. This is a tradeoff that can be adjusted to suit the needs of each application, and we are working on improving it behind the scenes.
+- By default, the list looks for a `key` prop on each item and uses that for the React key. Alternatively, you can provide a custom `keyExtractor` prop.
+
+---
+
+# Reference
+
+## Props
+
+### [ScrollView Props](scrollview.md#props)
+
+Inherits [ScrollView Props](scrollview.md#props), unless it is nested in another FlatList of same orientation.
+
+---
+
+###
Required
**`renderItem`**
+
+```jsx
+renderItem({ item, index, separators });
+```
+
+Takes an item from `data` and renders it into the list.
+
+Provides additional metadata like `index` if you need it, as well as a more generic `separators.updateProps` function which let you set whatever props you want to change the rendering of either the leading separator or trailing separator in case the more common `highlight` and `unhighlight` (which set the `highlighted: boolean` prop) are insufficient for your use case.
+
+| Type |
+| -------- |
+| function |
+
+- `item` (Object): The item from `data` being rendered.
+- `index` (number): The index corresponding to this item in the `data` array.
+- `separators` (Object)
+ - `highlight` (Function)
+ - `unhighlight` (Function)
+ - `updateProps` (Function)
+ - `select` (enum('leading', 'trailing'))
+ - `newProps` (Object)
+
+Example usage:
+
+```jsx
+ (
+
+ ))
+ }
+ data={[{ title: 'Title Text', key: 'item1' }]}
+ renderItem={({ item, index, separators }) => (
+ this._onPress(item)}
+ onShowUnderlay={separators.highlight}
+ onHideUnderlay={separators.unhighlight}>
+
+ {item.title}
+
+
+ )}
+/>
+```
+
+---
+
+###
Required
**`data`**
+
+For simplicity, data is a plain array. If you want to use something else, like an immutable list, use the underlying [`VirtualizedList`](virtualizedlist.md) directly.
+
+| Type |
+| ----- |
+| array |
+
+---
+
+### `ItemSeparatorComponent`
+
+Rendered in between each item, but not at the top or bottom. By default, `highlighted` and `leadingItem` props are provided. `renderItem` provides `separators.highlight`/`unhighlight` which will update the `highlighted` prop, but you can also add custom props with `separators.updateProps`.
+
+| Type |
+| --------- |
+| component |
+
+---
+
+### `ListEmptyComponent`
+
+Rendered when the list is empty. Can be a React Component (e.g. `SomeComponent`), or a React element (e.g. ``).
+
+| Type |
+| ------------------ |
+| component, element |
+
+---
+
+### `ListFooterComponent`
+
+Rendered at the bottom of all the items. Can be a React Component (e.g. `SomeComponent`), or a React element (e.g. ``).
+
+| Type |
+| ------------------ |
+| component, element |
+
+---
+
+### `ListFooterComponentStyle`
+
+Styling for internal View for `ListFooterComponent`.
+
+| Type |
+| ------------------------------ |
+| [View Style](view-style-props) |
+
+---
+
+### `ListHeaderComponent`
+
+Rendered at the top of all the items. Can be a React Component (e.g. `SomeComponent`), or a React element (e.g. ``).
+
+| Type |
+| ------------------ |
+| component, element |
+
+---
+
+### `ListHeaderComponentStyle`
+
+Styling for internal View for `ListHeaderComponent`.
+
+| Type |
+| ------------------------------ |
+| [View Style](view-style-props) |
+
+---
+
+### `columnWrapperStyle`
+
+Optional custom style for multi-item rows generated when `numColumns > 1`.
+
+| Type |
+| ------------------------------ |
+| [View Style](view-style-props) |
+
+---
+
+### `extraData`
+
+A marker property for telling the list to re-render (since it implements `PureComponent`). If any of your `renderItem`, Header, Footer, etc. functions depend on anything outside of the `data` prop, stick it here and treat it immutably.
+
+| Type |
+| ---- |
+| any |
+
+---
+
+### `getItemLayout`
+
+```jsx
+(data, index) => {length: number, offset: number, index: number}
+```
+
+`getItemLayout` is an optional optimization that allows skipping the measurement of dynamic content if you know the size (height or width) of items ahead of time. `getItemLayout` is efficient if you have fixed size items, for example:
+
+```jsx
+ getItemLayout={(data, index) => (
+ {length: ITEM_HEIGHT, offset: ITEM_HEIGHT * index, index}
+ )}
+```
+
+Adding `getItemLayout` can be a great performance boost for lists of several hundred items. Remember to include separator length (height or width) in your offset calculation if you specify `ItemSeparatorComponent`.
+
+| Type |
+| -------- |
+| function |
+
+---
+
+### `horizontal`
+
+If `true`, renders items next to each other horizontally instead of stacked vertically.
+
+| Type |
+| ------- |
+| boolean |
+
+---
+
+### `initialNumToRender`
+
+How many items to render in the initial batch. This should be enough to fill the screen but not much more. Note these items will never be unmounted as part of the windowed rendering in order to improve perceived performance of scroll-to-top actions.
+
+| Type | Default |
+| ------ | ------- |
+| number | `10` |
+
+---
+
+### `initialScrollIndex`
+
+Instead of starting at the top with the first item, start at `initialScrollIndex`. This disables the "scroll to top" optimization that keeps the first `initialNumToRender` items always rendered and immediately renders the items starting at this initial index. Requires `getItemLayout` to be implemented.
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `inverted`
+
+Reverses the direction of scroll. Uses scale transforms of `-1`.
+
+| Type |
+| ------- |
+| boolean |
+
+---
+
+### `keyExtractor`
+
+```jsx
+(item: object, index: number) => string;
+```
+
+Used to extract a unique key for a given item at the specified index. Key is used for caching and as the react key to track item re-ordering. The default extractor checks `item.key`, then `item.id`, and then falls back to using the index, like React does.
+
+| Type |
+| -------- |
+| function |
+
+---
+
+### `numColumns`
+
+Multiple columns can only be rendered with `horizontal={false}` and will zig-zag like a `flexWrap` layout. Items should all be the same height - masonry layouts are not supported.
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `onEndReached`
+
+```jsx
+(info: {distanceFromEnd: number}) => void
+```
+
+Called once when the scroll position gets within `onEndReachedThreshold` of the rendered content.
+
+| Type |
+| -------- |
+| function |
+
+---
+
+### `onEndReachedThreshold`
+
+How far from the end (in units of visible length of the list) the bottom edge of the list must be from the end of the content to trigger the `onEndReached` callback. Thus a value of 0.5 will trigger `onEndReached` when the end of the content is within half the visible length of the list.
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `onRefresh`
+
+```jsx
+() => void
+```
+
+If provided, a standard RefreshControl will be added for "Pull to Refresh" functionality. Make sure to also set the `refreshing` prop correctly.
+
+| Type |
+| -------- |
+| function |
+
+---
+
+### `onViewableItemsChanged`
+
+Called when the viewability of rows changes, as defined by the `viewabilityConfig` prop.
+
+| Type |
+| ------------------------------------------------------------------------------------------------------------------ |
+| (callback: { changed: array of [ViewToken](viewtoken)s, viewableItems: array of [ViewToken](viewtoken)s }) => void |
+
+---
+
+### `progressViewOffset`
+
+Set this when offset is needed for the loading indicator to show correctly.
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `refreshing`
+
+Set this true while waiting for new data from a refresh.
+
+| Type |
+| ------- |
+| boolean |
+
+---
+
+### `removeClippedSubviews`
+
+This may improve scroll performance for large lists. On Android the default value is `true`.
+
+> Note: May have bugs (missing content) in some circumstances - use at your own risk.
+
+| Type |
+| ------- |
+| boolean |
+
+---
+
+### `viewabilityConfig`
+
+See [`ViewabilityHelper.js`](https://github.com/facebook/react-native/blob/master/Libraries/Lists/ViewabilityHelper.js) for flow type and further documentation.
+
+| Type |
+| ----------------- |
+| ViewabilityConfig |
+
+`viewabilityConfig` takes a type `ViewabilityConfig` an object with following properties
+
+| Property | Type |
+| -------------------------------- | ------- |
+| minimumViewTime | number |
+| viewAreaCoveragePercentThreshold | number |
+| itemVisiblePercentThreshold | number |
+| waitForInteraction | boolean |
+
+At least one of the `viewAreaCoveragePercentThreshold` or `itemVisiblePercentThreshold` is required. This needs to be done in the `constructor` to avoid following error ([ref](https://github.com/facebook/react-native/issues/17408)):
+
+```
+ Error: Changing viewabilityConfig on the fly is not supported
+```
+
+```jsx
+constructor (props) {
+ super(props)
+
+ this.viewabilityConfig = {
+ waitForInteraction: true,
+ viewAreaCoveragePercentThreshold: 95
+ }
+}
+```
+
+```jsx
+ Note: Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
+
+**Parameters:**
+
+| Name | Type |
+| ----------------------------------------------------------- | ------ |
+| params
Required
| object |
+
+Valid `params` keys are:
+
+- 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to `true`.
+- 'index' (number) - The index to scroll to. Required.
+- 'viewOffset' (number) - A fixed number of pixels to offset the final target position.
+- 'viewPosition' (number) - A value of `0` places the item specified by index at the top, `1` at the bottom, and `0.5` centered in the middle.
+
+---
+
+### `scrollToItem()`
+
+```jsx
+scrollToItem(params);
+```
+
+Requires linear scan through data - use `scrollToIndex` instead if possible.
+
+> Note: Cannot scroll to locations outside the render window without specifying the `getItemLayout` prop.
+
+**Parameters:**
+
+| Name | Type |
+| ----------------------------------------------------------- | ------ |
+| params
Required
| object |
+
+Valid `params` keys are:
+
+- 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to `true`.
+- 'item' (object) - The item to scroll to. Required.
+- 'viewPosition' (number)
+
+---
+
+### `scrollToOffset()`
+
+```jsx
+scrollToOffset(params);
+```
+
+Scroll to a specific content pixel offset in the list.
+
+**Parameters:**
+
+| Name | Type |
+| ----------------------------------------------------------- | ------ |
+| params
Required
| object |
+
+Valid `params` keys are:
+
+- 'offset' (number) - The offset to scroll to. In case of `horizontal` being true, the offset is the x-value, in any other case the offset is the y-value. Required.
+- 'animated' (boolean) - Whether the list should do an animation while scrolling. Defaults to `true`.
diff --git a/website/versioned_docs/version-0.70/flexbox.md b/website/versioned_docs/version-0.70/flexbox.md
new file mode 100644
index 00000000000..4ba10df006b
--- /dev/null
+++ b/website/versioned_docs/version-0.70/flexbox.md
@@ -0,0 +1,1519 @@
+---
+id: flexbox
+title: Layout with Flexbox
+---
+
+A component can specify the layout of its children using the Flexbox algorithm. Flexbox is designed to provide a consistent layout on different screen sizes.
+
+You will normally use a combination of `flexDirection`, `alignItems`, and `justifyContent` to achieve the right layout.
+
+:::caution
+Flexbox works the same way in React Native as it does in CSS on the web, with a few exceptions.
+The defaults are different, with `flexDirection` defaulting to `column` instead of `row`, `alignContent` defaulting to `flex-start` instead of `stretch`, `flexShrink` defaulting to `0` instead of `1`, the `flex` parameter only supporting a single number.
+:::
+
+## Flex
+
+[`flex`](layout-props#flex) will define how your items are going to **“fill”** over the available space along your main axis. Space will be divided according to each element's flex property.
+
+In the following example, the red, yellow, and green views are all children in the container view that has `flex: 1` set. The red view uses `flex: 1` , the yellow view uses `flex: 2`, and the green view uses `flex: 3` . **1+2+3 = 6**, which means that the red view will get `1/6` of the space, the yellow `2/6` of the space, and the green `3/6` of the space.
+
+```SnackPlayer name=Flex%20Example
+import React from "react";
+import { StyleSheet, Text, View } from "react-native";
+
+const Flex = () => {
+ return (
+
+
+
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ padding: 20,
+ },
+});
+
+export default Flex;
+```
+
+## Flex Direction
+
+[`flexDirection`](layout-props#flexdirection) controls the direction in which the children of a node are laid out. This is also referred to as the main axis. The cross axis is the axis perpendicular to the main axis, or the axis which the wrapping lines are laid out in.
+
+- `column` (**default value**) Align children from top to bottom. If wrapping is enabled, then the next line will start to the right of the first item on the top of the container.
+
+- `row` Align children from left to right. If wrapping is enabled, then the next line will start under the first item on the left of the container.
+
+- `column-reverse` Align children from bottom to top. If wrapping is enabled, then the next line will start to the right of the first item on the bottom of the container.
+
+- `row-reverse` Align children from right to left. If wrapping is enabled, then the next line will start under the first item on the right of the container.
+
+You can learn more [here](https://yogalayout.com/docs/flex-direction).
+
+```SnackPlayer name=Flex%20Direction
+import React, { useState } from "react";
+import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
+
+const FlexDirectionBasics = () => {
+ const [flexDirection, setflexDirection] = useState("column");
+
+ return (
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[
+ styles.button,
+ selectedValue === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ {children}
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ },
+ box: {
+ width: 50,
+ height: 50,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default FlexDirectionBasics;
+```
+
+## Layout Direction
+
+Layout [`direction`](layout-props#direction) specifies the direction in which children and text in a hierarchy should be laid out. Layout direction also affects what edge `start` and `end` refer to. By default, React Native lays out with LTR layout direction. In this mode `start` refers to left and `end` refers to right.
+
+- `LTR` (**default value**) Text and children are laid out from left to right. Margin and padding applied to the start of an element are applied on the left side.
+
+- `RTL` Text and children are laid out from right to left. Margin and padding applied to the start of an element are applied on the right side.
+
+```SnackPlayer name=Flex%20Direction
+import React, { useState } from "react";
+import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
+
+const DirectionLayout = () => {
+ const [direction, setDirection] = useState("ltr");
+
+ return (
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[
+ styles.button,
+ selectedValue === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ {children}
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ },
+ box: {
+ width: 50,
+ height: 50,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default DirectionLayout;
+```
+
+## Justify Content
+
+[`justifyContent`](layout-props#justifycontent) describes how to align children within the main axis of their container. For example, you can use this property to center a child horizontally within a container with `flexDirection` set to `row` or vertically within a container with `flexDirection` set to `column`.
+
+- `flex-start`(**default value**) Align children of a container to the start of the container's main axis.
+
+- `flex-end` Align children of a container to the end of the container's main axis.
+
+- `center` Align children of a container in the center of the container's main axis.
+
+- `space-between` Evenly space off children across the container's main axis, distributing the remaining space between the children.
+
+- `space-around` Evenly space off children across the container's main axis, distributing the remaining space around the children. Compared to `space-between`, using `space-around` will result in space being distributed to the beginning of the first child and end of the last child.
+
+- `space-evenly` Evenly distribute children within the alignment container along the main axis. The spacing between each pair of adjacent items, the main-start edge and the first item, and the main-end edge and the last item, are all exactly the same.
+
+You can learn more [here](https://yogalayout.com/docs/justify-content).
+
+```SnackPlayer name=Justify%20Content
+import React, { useState } from "react";
+import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
+
+const JustifyContentBasics = () => {
+ const [justifyContent, setJustifyContent] = useState("flex-start");
+
+ return (
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[styles.button, selectedValue === value && styles.selected]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ {children}
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ },
+ box: {
+ width: 50,
+ height: 50,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default JustifyContentBasics;
+```
+
+## Align Items
+
+[`alignItems`](layout-props#alignitems) describes how to align children along the cross axis of their container. It is very similar to `justifyContent` but instead of applying to the main axis, `alignItems` applies to the cross axis.
+
+- `stretch` (**default value**) Stretch children of a container to match the `height` of the container's cross axis.
+
+- `flex-start` Align children of a container to the start of the container's cross axis.
+
+- `flex-end` Align children of a container to the end of the container's cross axis.
+
+- `center` Align children of a container in the center of the container's cross axis.
+
+- `baseline` Align children of a container along a common baseline. Individual children can be set to be the reference baseline for their parents.
+
+:::info
+For `stretch` to have an effect, children must not have a fixed dimension along the secondary axis. In the following example, setting `alignItems: stretch` does nothing until the `width: 50` is removed from the children.
+:::
+
+You can learn more [here](https://yogalayout.com/docs/align-items).
+
+```SnackPlayer name=Align%20Items
+import React, { useState } from "react";
+import {
+ View,
+ TouchableOpacity,
+ Text,
+ StyleSheet,
+} from "react-native";
+
+const AlignItemsLayout = () => {
+ const [alignItems, setAlignItems] = useState("stretch");
+
+ return (
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[
+ styles.button,
+ selectedValue === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ {children}
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ minHeight: 200,
+ },
+ box: {
+ width: 50,
+ height: 50,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default AlignItemsLayout;
+```
+
+## Align Self
+
+[`alignSelf`](layout-props#alignself) has the same options and effect as `alignItems` but instead of affecting the children within a container, you can apply this property to a single child to change its alignment within its parent. `alignSelf` overrides any option set by the parent with `alignItems`.
+
+```SnackPlayer name=Align%20Self
+import React, { useState } from "react";
+import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
+
+const AlignSelfLayout = () => {
+ const [alignSelf, setAlignSelf] = useState("stretch");
+
+ return (
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[
+ styles.button,
+ selectedValue === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ {children}
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ minHeight: 200,
+ },
+ box: {
+ width: 50,
+ height: 50,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default AlignSelfLayout;
+```
+
+## Align Content
+
+[alignContent](layout-props#aligncontent) defines the distribution of lines along the cross-axis. This only has effect when items are wrapped to multiple lines using `flexWrap`.
+
+- `flex-start` (**default value**) Align wrapped lines to the start of the container's cross axis.
+
+- `flex-end` Align wrapped lines to the end of the container's cross axis.
+
+- `stretch` (_default value when using Yoga on the web_) Stretch wrapped lines to match the height of the container's cross axis.
+
+- `center` Align wrapped lines in the center of the container's cross axis.
+
+- `space-between` Evenly space wrapped lines across the container's cross axis, distributing the remaining space between the lines.
+
+- `space-around` Evenly space wrapped lines across the container's cross axis, distributing the remaining space around the lines. Compared to `space-between`, using `space-around` will result in space being distributed to the beginning of the first line and the end of the last line.
+
+You can learn more [here](https://yogalayout.com/docs/align-content).
+
+```SnackPlayer name=Align%20Content
+import React, { useState } from "react";
+import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
+
+const AlignContentLayout = () => {
+ const [alignContent, setAlignContent] = useState("flex-start");
+
+ return (
+
+
+
+
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[
+ styles.button,
+ selectedValue === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ {children}
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ flexWrap: "wrap",
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ maxHeight: 400,
+ },
+ box: {
+ width: 50,
+ height: 80,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default AlignContentLayout;
+```
+
+## Flex Wrap
+
+The [`flexWrap`](layout-props#flexwrap) property is set on containers and it controls what happens when children overflow the size of the container along the main axis. By default, children are forced into a single line (which can shrink elements). If wrapping is allowed, items are wrapped into multiple lines along the main axis if needed.
+
+When wrapping lines, `alignContent` can be used to specify how the lines are placed in the container. Learn more [here](https://yogalayout.com/docs/flex-wrap).
+
+```SnackPlayer name=Flex%20Wrap
+import React, { useState } from "react";
+import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
+
+const FlexWrapLayout = () => {
+ const [flexWrap, setFlexWrap] = useState("wrap");
+
+ return (
+
+
+
+
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[
+ styles.button,
+ selectedValue === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ {children}
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ maxHeight: 400,
+ },
+ box: {
+ width: 50,
+ height: 80,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default FlexWrapLayout;
+```
+
+## Flex Basis, Grow, and Shrink
+
+- [`flexBasis`](layout-props#flexbasis) is an axis-independent way of providing the default size of an item along the main axis. Setting the `flexBasis` of a child is similar to setting the `width` of that child if its parent is a container with `flexDirection: row` or setting the `height` of a child if its parent is a container with `flexDirection: column`. The `flexBasis` of an item is the default size of that item, the size of the item before any `flexGrow` and `flexShrink` calculations are performed.
+
+- [`flexGrow`](layout-props#flexgrow) describes how any space within a container should be distributed among its children along the main axis. After laying out its children, a container will distribute any remaining space according to the flex grow values specified by its children.
+
+ `flexGrow` accepts any floating point value >= 0, with 0 being the default value. A container will distribute any remaining space among its children weighted by the children’s `flexGrow` values.
+
+- [`flexShrink`](layout-props#flexshrink) describes how to shrink children along the main axis in the case in which the total size of the children overflows the size of the container on the main axis. `flexShrink` is very similar to `flexGrow` and can be thought of in the same way if any overflowing size is considered to be negative remaining space. These two properties also work well together by allowing children to grow and shrink as needed.
+
+ `flexShrink` accepts any floating point value >= 0, with 0 being the default value (on the web, the default is 1). A container will shrink its children weighted by the children’s `flexShrink` values.
+
+You can learn more [here](https://yogalayout.com/docs/flex).
+
+```SnackPlayer name=Flex%20Basis%2C%20Grow%2C%20and%20Shrink
+import React, { useState } from "react";
+import {
+ View,
+ Text,
+ TextInput,
+ StyleSheet,
+} from "react-native";
+
+const App = () => {
+ const [powderblue, setPowderblue] = useState({
+ flexGrow: 0,
+ flexShrink: 1,
+ flexBasis: "auto",
+ });
+ const [skyblue, setSkyblue] = useState({
+ flexGrow: 1,
+ flexShrink: 0,
+ flexBasis: 100,
+ });
+ const [steelblue, setSteelblue] = useState({
+ flexGrow: 0,
+ flexShrink: 1,
+ flexBasis: 200,
+ });
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+const BoxInfo = ({
+ color,
+ flexBasis,
+ flexShrink,
+ setStyle,
+ flexGrow,
+}) => (
+
+
+
+ Box
+
+
+ flexBasis
+
+ setStyle((value) => ({
+ ...value,
+ flexBasis: isNaN(parseInt(fB))
+ ? "auto"
+ : parseInt(fB),
+ }))
+ }
+ />
+ flexShrink
+
+ setStyle((value) => ({
+ ...value,
+ flexShrink: isNaN(parseInt(fS))
+ ? ""
+ : parseInt(fS),
+ }))
+ }
+ />
+ flexGrow
+
+ setStyle((value) => ({
+ ...value,
+ flexGrow: isNaN(parseInt(fG))
+ ? ""
+ : parseInt(fG),
+ }))
+ }
+ />
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ paddingHorizontal: 10,
+ },
+ box: {
+ flex: 1,
+ height: 50,
+ width: 50,
+ },
+ boxLabel: {
+ minWidth: 80,
+ padding: 8,
+ borderRadius: 4,
+ marginTop: 8,
+ },
+ label: {
+ marginTop: 6,
+ fontSize: 16,
+ fontWeight: "100",
+ },
+ previewContainer: {
+ flex: 1,
+ flexDirection: "row",
+ backgroundColor: "aliceblue",
+ },
+ row: {
+ flex: 1,
+ flexDirection: "row",
+ flexWrap: "wrap",
+ alignItems: "center",
+ marginBottom: 10,
+ },
+ input: {
+ borderBottomWidth: 1,
+ paddingVertical: 3,
+ width: 50,
+ textAlign: "center",
+ },
+});
+
+export default App;
+```
+
+## Width and Height
+
+The `width` property specifies the width of an element's content area. Similarly, the `height` property specifies the height of an element's content area.
+
+Both `width` and `height` can take the following values:
+
+- `auto` (**default value**) React Native calculates the width/height for the element based on its content, whether that is other children, text, or an image.
+
+- `pixels` Defines the width/height in absolute pixels. Depending on other styles set on the component, this may or may not be the final dimension of the node.
+
+- `percentage` Defines the width or height in percentage of its parent's width or height, respectively.
+
+```SnackPlayer name=Width%20and%20Height
+import React, { useState } from "react";
+import {
+ View,
+ SafeAreaView,
+ TouchableOpacity,
+ Text,
+ StyleSheet,
+} from "react-native";
+
+const WidthHeightBasics = () => {
+ const [widthType, setWidthType] = useState("auto");
+ const [heightType, setHeightType] = useState("auto");
+
+ return (
+
+
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ children,
+ widthType,
+ heightType,
+ widthValues,
+ heightValues,
+ setWidthType,
+ setHeightType,
+}) => (
+
+
+ width
+ {widthValues.map((value) => (
+ setWidthType(value)}
+ style={[
+ styles.button,
+ widthType === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+
+ height
+ {heightValues.map((value) => (
+ setHeightType(value)}
+ style={[
+ styles.button,
+ heightType === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+ {children}
+
+);
+
+const styles = StyleSheet.create({
+ box: {
+ width: 50,
+ height: 50,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ padding: 8,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginRight: 10,
+ marginBottom: 10,
+ },
+ selected: {
+ backgroundColor: "coral",
+ shadowOpacity: 0,
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default WidthHeightBasics;
+```
+
+## Absolute & Relative Layout
+
+The `position` type of an element defines how it is positioned within its parent.
+
+- `relative` (**default value**) By default, an element is positioned relatively. This means an element is positioned according to the normal flow of the layout, and then offset relative to that position based on the values of `top`, `right`, `bottom`, and `left`. The offset does not affect the position of any sibling or parent elements.
+
+- `absolute` When positioned absolutely, an element doesn't take part in the normal layout flow. It is instead laid out independent of its siblings. The position is determined based on the `top`, `right`, `bottom`, and `left` values.
+
+```SnackPlayer name=Absolute%20%26%20Relative%20Layout
+import React, { useState } from "react";
+import {
+ View,
+ SafeAreaView,
+ TouchableOpacity,
+ Text,
+ StyleSheet,
+} from "react-native";
+
+const PositionLayout = () => {
+ const [position, setPosition] = useState("relative");
+
+ return (
+
+
+
+
+
+ );
+};
+
+const PreviewLayout = ({
+ label,
+ children,
+ values,
+ selectedValue,
+ setSelectedValue,
+}) => (
+
+ {label}
+
+ {values.map((value) => (
+ setSelectedValue(value)}
+ style={[
+ styles.button,
+ selectedValue === value && styles.selected,
+ ]}
+ >
+
+ {value}
+
+
+ ))}
+
+ {children}
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ marginTop: 8,
+ backgroundColor: "aliceblue",
+ minHeight: 200,
+ },
+ box: {
+ width: 50,
+ height: 50,
+ },
+ row: {
+ flexDirection: "row",
+ flexWrap: "wrap",
+ },
+ button: {
+ paddingHorizontal: 8,
+ paddingVertical: 6,
+ borderRadius: 4,
+ backgroundColor: "oldlace",
+ alignSelf: "flex-start",
+ marginHorizontal: "1%",
+ marginBottom: 6,
+ minWidth: "48%",
+ textAlign: "center",
+ },
+ selected: {
+ backgroundColor: "coral",
+ borderWidth: 0,
+ },
+ buttonLabel: {
+ fontSize: 12,
+ fontWeight: "500",
+ color: "coral",
+ },
+ selectedLabel: {
+ color: "white",
+ },
+ label: {
+ textAlign: "center",
+ marginBottom: 10,
+ fontSize: 24,
+ },
+});
+
+export default PositionLayout;
+```
+
+## Going Deeper
+
+Check out the interactive [yoga playground](https://yogalayout.com/playground) that you can use to get a better understanding of flexbox.
+
+We've covered the basics, but there are many other styles you may need for layouts. The full list of props that control layout is documented [here](./layout-props.md).
+
+Additionally, you can see some examples from [Wix Engineers](https://medium.com/wix-engineering/the-full-react-native-layout-cheat-sheet-a4147802405c).
diff --git a/website/versioned_docs/version-0.70/gesture-responder-system.md b/website/versioned_docs/version-0.70/gesture-responder-system.md
new file mode 100644
index 00000000000..ed29d81c7ca
--- /dev/null
+++ b/website/versioned_docs/version-0.70/gesture-responder-system.md
@@ -0,0 +1,66 @@
+---
+id: gesture-responder-system
+title: Gesture Responder System
+---
+
+The gesture responder system manages the lifecycle of gestures in your app. A touch can go through several phases as the app determines what the user's intention is. For example, the app needs to determine if the touch is scrolling, sliding on a widget, or tapping. This can even change during the duration of a touch. There can also be multiple simultaneous touches.
+
+The touch responder system is needed to allow components to negotiate these touch interactions without any additional knowledge about their parent or child components.
+
+### Best Practices
+
+To make your app feel great, every action should have the following attributes:
+
+- Feedback/highlighting- show the user what is handling their touch, and what will happen when they release the gesture
+- Cancel-ability- when making an action, the user should be able to abort it mid-touch by dragging their finger away
+
+These features make users more comfortable while using an app, because it allows people to experiment and interact without fear of making mistakes.
+
+### TouchableHighlight and Touchable\*
+
+The responder system can be complicated to use. So we have provided an abstract `Touchable` implementation for things that should be "tappable". This uses the responder system and allows you to configure tap interactions declaratively. Use `TouchableHighlight` anywhere where you would use a button or link on web.
+
+## Responder Lifecycle
+
+A view can become the touch responder by implementing the correct negotiation methods. There are two methods to ask the view if it wants to become responder:
+
+- `View.props.onStartShouldSetResponder: (evt) => true,` - Does this view want to become responder on the start of a touch?
+- `View.props.onMoveShouldSetResponder: (evt) => true,` - Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness?
+
+If the View returns true and attempts to become the responder, one of the following will happen:
+
+- `View.props.onResponderGrant: (evt) => {}` - The View is now responding for touch events. This is the time to highlight and show the user what is happening
+- `View.props.onResponderReject: (evt) => {}` - Something else is the responder right now and will not release it
+
+If the view is responding, the following handlers can be called:
+
+- `View.props.onResponderMove: (evt) => {}` - The user is moving their finger
+- `View.props.onResponderRelease: (evt) => {}` - Fired at the end of the touch, ie "touchUp"
+- `View.props.onResponderTerminationRequest: (evt) => true` - Something else wants to become responder. Should this view release the responder? Returning true allows release
+- `View.props.onResponderTerminate: (evt) => {}` - The responder has been taken from the View. Might be taken by other views after a call to `onResponderTerminationRequest`, or might be taken by the OS without asking (happens with control center/ notification center on iOS)
+
+`evt` is a synthetic touch event with the following form:
+
+- `nativeEvent`
+ - `changedTouches` - Array of all touch events that have changed since the last event
+ - `identifier` - The ID of the touch
+ - `locationX` - The X position of the touch, relative to the element
+ - `locationY` - The Y position of the touch, relative to the element
+ - `pageX` - The X position of the touch, relative to the root element
+ - `pageY` - The Y position of the touch, relative to the root element
+ - `target` - The node id of the element receiving the touch event
+ - `timestamp` - A time identifier for the touch, useful for velocity calculation
+ - `touches` - Array of all current touches on the screen
+
+### Capture ShouldSet Handlers
+
+`onStartShouldSetResponder` and `onMoveShouldSetResponder` are called with a bubbling pattern, where the deepest node is called first. That means that the deepest component will become responder when multiple Views return true for `*ShouldSetResponder` handlers. This is desirable in most cases, because it makes sure all controls and buttons are usable.
+
+However, sometimes a parent will want to make sure that it becomes responder. This can be handled by using the capture phase. Before the responder system bubbles up from the deepest component, it will do a capture phase, firing `on*ShouldSetResponderCapture`. So if a parent View wants to prevent the child from becoming responder on a touch start, it should have a `onStartShouldSetResponderCapture` handler which returns true.
+
+- `View.props.onStartShouldSetResponderCapture: (evt) => true,`
+- `View.props.onMoveShouldSetResponderCapture: (evt) => true,`
+
+### PanResponder
+
+For higher-level gesture interpretation, check out [PanResponder](panresponder.md).
diff --git a/website/versioned_docs/version-0.70/getting-started.md b/website/versioned_docs/version-0.70/getting-started.md
new file mode 100644
index 00000000000..7146a639dd2
--- /dev/null
+++ b/website/versioned_docs/version-0.70/getting-started.md
@@ -0,0 +1,168 @@
+---
+id: environment-setup
+title: Setting up the development environment
+hide_table_of_contents: true
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+import GuideLinuxAndroid from './\_getting-started-linux-android.md'; import GuideMacOSAndroid from './\_getting-started-macos-android.md'; import GuideWindowsAndroid from './\_getting-started-windows-android.md'; import GuideMacOSIOS from './\_getting-started-macos-ios.md';
+
+This page will help you install and build your first React Native app.
+
+**If you are new to mobile development**, the easiest way to get started is with Expo Go. Expo is a set of tools and services built around React Native and, while it has many [features](https://docs.expo.dev), the most relevant feature for us right now is that it can get you writing a React Native app within minutes. You will only need a recent version of Node.js and a phone or emulator. If you'd like to try out React Native directly in your web browser before installing any tools, you can try out [Snack](https://snack.expo.dev/).
+
+**If you are already familiar with mobile development**, you may want to use React Native CLI. It requires Xcode or Android Studio to get started. If you already have one of these tools installed, you should be able to get up and running within a few minutes. If they are not installed, you should expect to spend about an hour installing and configuring them.
+
+
+
+
+Run the following command to create a new React Native project called "AwesomeProject":
+
+
+
+
+```shell
+npx create-expo-app AwesomeProject
+
+cd AwesomeProject
+npm start # you can also use: npx expo start
+```
+
+
+
+
+```shell
+yarn create expo-app AwesomeProject
+
+cd AwesomeProject
+yarn start # you can also use: yarn expo start
+```
+
+
+
+
+This will start a development server for you.
+
+
Running your React Native application
+
+Install the [Expo Go](https://expo.dev/client) app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.
+
+
Modifying your app
+
+Now that you have successfully run the app, let's modify it. Open `App.js` in your text editor of choice and edit some lines. The application should reload automatically once you save your changes.
+
+
That's it!
+
+Congratulations! You've successfully run and modified your first React Native app.
+
+
+
+
Now what?
+
+Expo also has [docs](https://docs.expo.dev) you can reference if you have questions specific to the tool. You can also ask for help on the [Expo Discord](https://chat.expo.dev).
+
+If you have a problem with Expo, before creating a new issue, please see if there's an existing issue about it in the [Expo issues](https://github.com/expo/expo/issues).
+
+If you're curious to learn more about React Native, check out the [Introduction to React Native](getting-started).
+
+
Running your app on a simulator or virtual device
+
+Expo Go allows you to run your React Native app on a physical device without installing iOS and Android native SDKs. If you want to run your app on the iOS Simulator or an Android Virtual Device, please refer to the instructions for "React Native CLI Quickstart" to learn how to install Xcode or set up your Android development environment.
+
+Once you've set these up, you can launch your app on an Android Virtual Device by running `npm run android`, or on the iOS Simulator by running `npm run ios` (macOS only).
+
+
Caveats
+
+The Expo Go app is a great tool to get started — it exists to help developers quickly get projects off the ground, to experiment with ideas (such as on [Snack](https://snack.expo.dev/)) and share their work with minimal friction. Expo Go makes this possible by including a feature-rich native runtime made up of every module in the [Expo SDK](https://docs.expo.dev/versions/latest/), so all you need to do to use a module is install the package with `npx expo install` and reload your app.
+
+The tradeoff is that the Expo Go app does not allow you to add custom native code — you can only use native modules built into the Expo SDK. There are many great libraries available outside of the Expo SDK, and you may even want to build your own native library. You can leverage these libraries with [development builds](https://docs.expo.dev/development/introduction/), or by using ["prebuild"](https://docs.expo.dev/workflow/prebuild/) to generate the native projects, or both. [Learn more about adding native code to projects created with `create-expo-app`](https://docs.expo.dev/workflow/customizing/).
+
+`create-expo-app` configures your project to use the most recent React Native version that is supported by the Expo SDK. The Expo Go app usually gains support for a given React Native version with new SDK versions (released quarterly). You can check [this document](https://docs.expo.dev/versions/latest/#each-expo-sdk-version-depends-on-a) to find out what versions are supported.
+
+If you're integrating React Native into an existing project, [you can use the Expo SDK](https://docs.expo.dev/bare/installing-expo-modules/) and [development builds](https://docs.expo.dev/development/introduction/), but you will need to set up a native development environment. Select "React Native CLI Quickstart" above for instructions on configuring a native build environment for React Native.
+
+
+
+
+
Follow these instructions if you need to build native code in your project. For example, if you are integrating React Native into an existing application, or if you ran "prebuild" from Expo to generate your project's native code, you'll need this section.
+
+The instructions are a bit different depending on your development operating system, and whether you want to start developing for iOS or Android. If you want to develop for both Android and iOS, that's fine - you can pick one to start with, since the setup is a bit different.
+
+#### Development OS
+
+
+
+
+#### Target OS
+
+
+
+
+[//]: # 'macOS, Android'
+
+
+
+
+
+
+[//]: # 'macOS, iOS'
+
+
+
+
+
+
+
+
+
+#### Target OS
+
+
+
+
+[//]: # 'Windows, Android'
+
+
+
+
+
+
+[//]: # 'Windows, iOS'
+
+## Unsupported
+
+> A Mac is required to build projects with native code for iOS. You can follow the **Expo Go Quickstart** to learn how to build your app using Expo instead.
+
+
+
+
+
+
+
+#### Target OS
+
+
+
+
+[//]: # 'Linux, Android'
+
+
+
+
+
+
+[//]: # 'Linux, iOS'
+
+## Unsupported
+
+> A Mac is required to build projects with native code for iOS. You can follow the **Expo Go Quickstart** to learn how to build your app using Expo instead.
+
+
+
+
+
+
+
+
+
diff --git a/website/versioned_docs/version-0.70/handling-text-input.md b/website/versioned_docs/version-0.70/handling-text-input.md
new file mode 100644
index 00000000000..e150e5f0091
--- /dev/null
+++ b/website/versioned_docs/version-0.70/handling-text-input.md
@@ -0,0 +1,38 @@
+---
+id: handling-text-input
+title: Handling Text Input
+---
+
+[`TextInput`](textinput#content) is a [Core Component](intro-react-native-components) that allows the user to enter text. It has an `onChangeText` prop that takes a function to be called every time the text changed, and an `onSubmitEditing` prop that takes a function to be called when the text is submitted.
+
+For example, let's say that as the user types, you're translating their words into a different language. In this new language, every single word is written the same way: 🍕. So the sentence "Hello there Bob" would be translated as "🍕 🍕 🍕".
+
+```SnackPlayer name=Handling%20Text%20Input
+import React, { useState } from 'react';
+import { Text, TextInput, View } from 'react-native';
+
+const PizzaTranslator = () => {
+ const [text, setText] = useState('');
+ return (
+
+ setText(newText)}
+ defaultValue={text}
+ />
+
+ {text.split(' ').map((word) => word && '🍕').join(' ')}
+
+
+ );
+}
+
+export default PizzaTranslator;
+```
+
+In this example, we store `text` in the state, because it changes over time.
+
+There are a lot more things you might want to do with a text input. For example, you could validate the text inside while the user types. For more detailed examples, see the [React docs on controlled components](https://reactjs.org/docs/forms.html#controlled-components), or the [reference docs for TextInput](textinput.md).
+
+Text input is one of the ways the user interacts with the app. Next, let's look at another type of input and [learn how to handle touches](handling-touches.md).
diff --git a/website/versioned_docs/version-0.70/handling-touches.md b/website/versioned_docs/version-0.70/handling-touches.md
new file mode 100644
index 00000000000..c339e976e07
--- /dev/null
+++ b/website/versioned_docs/version-0.70/handling-touches.md
@@ -0,0 +1,178 @@
+---
+id: handling-touches
+title: Handling Touches
+---
+
+Users interact with mobile apps mainly through touch. They can use a combination of gestures, such as tapping on a button, scrolling a list, or zooming on a map. React Native provides components to handle all sorts of common gestures, as well as a comprehensive [gesture responder system](gesture-responder-system.md) to allow for more advanced gesture recognition, but the one component you will most likely be interested in is the basic Button.
+
+## Displaying a basic button
+
+[Button](button.md) provides a basic button component that is rendered nicely on all platforms. The minimal example to display a button looks like this:
+
+```jsx
+ {
+ alert('You tapped the button!');
+ }}
+ title="Press Me"
+/>
+```
+
+This will render a blue label on iOS, and a blue rounded rectangle with light text on Android. Pressing the button will call the "onPress" function, which in this case displays an alert popup. If you like, you can specify a "color" prop to change the color of your button.
+
+
+
+Go ahead and play around with the `Button` component using the example below. You can select which platform your app is previewed in by clicking on the toggle in the bottom right and then clicking on "Tap to Play" to preview the app.
+
+```SnackPlayer name=Button%20Basics
+import React, { Component } from 'react';
+import { Button, StyleSheet, View } from 'react-native';
+
+export default class ButtonBasics extends Component {
+ _onPressButton() {
+ alert('You tapped the button!')
+ }
+
+ render() {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ justifyContent: 'center',
+ },
+ buttonContainer: {
+ margin: 20
+ },
+ alternativeLayoutButtonContainer: {
+ margin: 20,
+ flexDirection: 'row',
+ justifyContent: 'space-between'
+ }
+});
+```
+
+## Touchables
+
+If the basic button doesn't look right for your app, you can build your own button using any of the "Touchable" components provided by React Native. The "Touchable" components provide the capability to capture tapping gestures, and can display feedback when a gesture is recognized. These components do not provide any default styling, however, so you will need to do a bit of work to get them looking nicely in your app.
+
+Which "Touchable" component you use will depend on what kind of feedback you want to provide:
+
+- Generally, you can use [**TouchableHighlight**](touchablehighlight.md) anywhere you would use a button or link on web. The view's background will be darkened when the user presses down on the button.
+
+- You may consider using [**TouchableNativeFeedback**](touchablenativefeedback.md) on Android to display ink surface reaction ripples that respond to the user's touch.
+
+- [**TouchableOpacity**](touchableopacity.md) can be used to provide feedback by reducing the opacity of the button, allowing the background to be seen through while the user is pressing down.
+
+- If you need to handle a tap gesture but you don't want any feedback to be displayed, use [**TouchableWithoutFeedback**](touchablewithoutfeedback.md).
+
+In some cases, you may want to detect when a user presses and holds a view for a set amount of time. These long presses can be handled by passing a function to the `onLongPress` props of any of the "Touchable" components.
+
+Let's see all of these in action:
+
+```SnackPlayer name=Touchables
+import React, { Component } from 'react';
+import { Platform, StyleSheet, Text, TouchableHighlight, TouchableOpacity, TouchableNativeFeedback, TouchableWithoutFeedback, View } from 'react-native';
+
+export default class Touchables extends Component {
+ _onPressButton() {
+ alert('You tapped the button!')
+ }
+
+ _onLongPressButton() {
+ alert('You long-pressed the button!')
+ }
+
+
+ render() {
+ return (
+
+
+
+ TouchableHighlight
+
+
+
+
+ TouchableOpacity
+
+
+
+
+ TouchableNativeFeedback {Platform.OS !== 'android' ? '(Android only)' : ''}
+
+
+
+
+ TouchableWithoutFeedback
+
+
+
+
+ Touchable with Long Press
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ paddingTop: 60,
+ alignItems: 'center'
+ },
+ button: {
+ marginBottom: 30,
+ width: 260,
+ alignItems: 'center',
+ backgroundColor: '#2196F3'
+ },
+ buttonText: {
+ textAlign: 'center',
+ padding: 20,
+ color: 'white'
+ }
+});
+```
+
+## Scrolling and swiping
+
+Gestures commonly used on devices with touchable screens include swipes and pans. These allow the user to scroll through a list of items, or swipe through pages of content. For these, check out the [ScrollView](scrollview.md) Core Component.
+
+## Known issues
+
+- [react-native#29308](https://github.com/facebook/react-native/issues/29308#issuecomment-792864162): The touch area never extends past the parent view bounds and on Android negative margin is not supported.
diff --git a/website/versioned_docs/version-0.70/headless-js-android.md b/website/versioned_docs/version-0.70/headless-js-android.md
new file mode 100644
index 00000000000..61bf1181e3b
--- /dev/null
+++ b/website/versioned_docs/version-0.70/headless-js-android.md
@@ -0,0 +1,397 @@
+---
+id: headless-js-android
+title: Headless JS
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
+import constants from '@site/core/TabsConstants';
+
+Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music.
+
+## The JS API
+
+A task is an async function that you register on `AppRegistry`, similar to registering React applications:
+
+```jsx
+import { AppRegistry } from 'react-native';
+AppRegistry.registerHeadlessTask('SomeTaskName', () =>
+ require('SomeTaskName')
+);
+```
+
+Then, in `SomeTaskName.js`:
+
+```jsx
+module.exports = async (taskData) => {
+ // do stuff
+};
+```
+
+You can do anything in your task such as network requests, timers and so on, as long as it doesn't touch UI. Once your task completes (i.e. the promise is resolved), React Native will go into "paused" mode (unless there are other tasks running, or there is a foreground app).
+
+## The Platform API
+
+Yes, this does still require some native code, but it's pretty thin. You need to extend `HeadlessJsTaskService` and override `getTaskConfig`, e.g.:
+
+
+
+
+```java
+package com.your_application_name;
+
+import android.content.Intent;
+import android.os.Bundle;
+import com.facebook.react.HeadlessJsTaskService;
+import com.facebook.react.bridge.Arguments;
+import com.facebook.react.jstasks.HeadlessJsTaskConfig;
+import javax.annotation.Nullable;
+
+public class MyTaskService extends HeadlessJsTaskService {
+
+ @Override
+ protected @Nullable HeadlessJsTaskConfig getTaskConfig(Intent intent) {
+ Bundle extras = intent.getExtras();
+ if (extras != null) {
+ return new HeadlessJsTaskConfig(
+ "SomeTaskName",
+ Arguments.fromBundle(extras),
+ 5000, // timeout for the task
+ false // optional: defines whether or not the task is allowed in foreground. Default is false
+ );
+ }
+ return null;
+ }
+}
+```
+
+
+
+
+```kotlin
+package com.your_application_name;
+
+import android.content.Intent
+import com.facebook.react.HeadlessJsTaskService
+import com.facebook.react.bridge.Arguments
+import com.facebook.react.jstasks.HeadlessJsTaskConfig
+
+class MyTaskService : HeadlessJsTaskService() {
+ override fun getTaskConfig(intent: Intent): HeadlessJsTaskConfig? {
+ return intent.extras?.let {
+ HeadlessJsTaskConfig(
+ "SomeT askName",
+ Arguments.fromBundle(it),
+ 5000, // timeout for the task
+ false // optional: defines whether or not the task is allowed in foreground.
+ // Default is false
+ )
+ }
+ }
+}
+
+```
+
+
+
+
+Then add the service to your `AndroidManifest.xml` file:
+
+```
+
+```
+
+Now, whenever you [start your service][0], e.g. as a periodic task or in response to some system event / broadcast, JS will spin up, run your task, then spin down.
+
+Example:
+
+
+
+
+```java
+Intent service = new Intent(getApplicationContext(), MyTaskService.class);
+Bundle bundle = new Bundle();
+
+bundle.putString("foo", "bar");
+service.putExtras(bundle);
+
+getApplicationContext().startService(service);
+```
+
+
+
+
+```kotlin
+val service = Intent(applicationContext, MyTaskService::class.java)
+val bundle = Bundle()
+
+bundle.putString("foo", "bar")
+
+service.putExtras(bundle)
+
+applicationContext.startService(service)
+```
+
+
+
+
+## Retries
+
+By default, the headless JS task will not perform any retries. In order to do so, you need to create a `HeadlessJsRetryPolicy` and throw a specific `Error`.
+
+`LinearCountingRetryPolicy` is an implementation of `HeadlessJsRetryPolicy` that allows you to specify a maximum number of retries with a fixed delay between each attempt. If that does not suit your needs then you can implement your own `HeadlessJsRetryPolicy`. These policies can be passed as an extra argument to the `HeadlessJsTaskConfig` constructor, e.g.
+
+
+
+
+```java
+HeadlessJsRetryPolicy retryPolicy = new LinearCountingRetryPolicy(
+ 3, // Max number of retry attempts
+ 1000 // Delay between each retry attempt
+);
+
+return new HeadlessJsTaskConfig(
+ 'SomeTaskName',
+ Arguments.fromBundle(extras),
+ 5000,
+ false,
+ retryPolicy
+);
+```
+
+
+
+
+```kotlin
+val retryPolicy: HeadlessJsTaskRetryPolicy =
+ LinearCountingRetryPolicy(
+ 3, // Max number of retry attempts
+ 1000 // Delay between each retry attempt
+ )
+
+return HeadlessJsTaskConfig("SomeTaskName", Arguments.fromBundle(extras), 5000, false, retryPolicy)
+```
+
+
+
+
+A retry attempt will only be made when a specific `Error` is thrown. Inside a headless JS task, you can import the error and throw it when a retry attempt is required.
+
+Example:
+
+```jsx
+import {HeadlessJsTaskError} from 'HeadlessJsTask';
+
+module.exports = async (taskData) => {
+ const condition = ...;
+ if (!condition) {
+ throw new HeadlessJsTaskError();
+ }
+};
+```
+
+If you wish all errors to cause a retry attempt, you will need to catch them and throw the above error.
+
+## Caveats
+
+- The function passed to `setTimeout` does not always behave as expected. Instead the function is called only when the application is launched again. If you only need to wait, use the retry functionality.
+- By default, your app will crash if you try to run a task while the app is in the foreground. This is to prevent developers from shooting themselves in the foot by doing a lot of work in a task and slowing the UI. You can pass a fourth `boolean` argument to control this behaviour.
+- If you start your service from a `BroadcastReceiver`, make sure to call `HeadlessJsTaskService.acquireWakeLockNow()` before returning from `onReceive()`.
+
+## Example Usage
+
+Service can be started from Java API. First you need to decide when the service should be started and implement your solution accordingly. Here is an example that reacts to network connection change.
+
+Following lines shows part of Android manifest file for registering broadcast receiver.
+
+```xml
+
+
+
+
+
+```
+
+Broadcast receiver then handles intent that was broadcasted in onReceive function. This is a great place to check whether your app is on foreground or not. If app is not on foreground we can prepare our intent to be started, with no information or additional information bundled using `putExtra` (keep in mind bundle can handle only parcelable values). In the end service is started and wakelock is acquired.
+
+
+
+
+```java
+import android.app.ActivityManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.net.ConnectivityManager;
+import android.net.Network;
+import android.net.NetworkCapabilities;
+import android.net.NetworkInfo;
+import android.os.Build;
+
+import com.facebook.react.HeadlessJsTaskService;
+
+public class NetworkChangeReceiver extends BroadcastReceiver {
+
+ @Override
+ public void onReceive(final Context context, final Intent intent) {
+ /**
+ This part will be called every time network connection is changed
+ e.g. Connected -> Not Connected
+ **/
+ if (!isAppOnForeground((context))) {
+ /**
+ We will start our service and send extra info about
+ network connections
+ **/
+ boolean hasInternet = isNetworkAvailable(context);
+ Intent serviceIntent = new Intent(context, MyTaskService.class);
+ serviceIntent.putExtra("hasInternet", hasInternet);
+ context.startService(serviceIntent);
+ HeadlessJsTaskService.acquireWakeLockNow(context);
+ }
+ }
+
+ private boolean isAppOnForeground(Context context) {
+ /**
+ We need to check if app is in foreground otherwise the app will crash.
+ http://stackoverflow.com/questions/8489993/check-android-application-is-in-foreground-or-not
+ **/
+ ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+ List appProcesses =
+ activityManager.getRunningAppProcesses();
+ if (appProcesses == null) {
+ return false;
+ }
+ final String packageName = context.getPackageName();
+ for (ActivityManager.RunningAppProcessInfo appProcess : appProcesses) {
+ if (appProcess.importance ==
+ ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
+ appProcess.processName.equals(packageName)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean isNetworkAvailable(Context context) {
+ ConnectivityManager cm = (ConnectivityManager)
+ context.getSystemService(Context.CONNECTIVITY_SERVICE);
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ Network networkCapabilities = cm.getActiveNetwork();
+
+ if(networkCapabilities == null) {
+ return false;
+ }
+
+ NetworkCapabilities actNw = cm.getNetworkCapabilities(networkCapabilities);
+
+ if(actNw == null) {
+ return false;
+ }
+
+ if(actNw.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) || actNw.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) || actNw.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ // deprecated in API level 29
+ NetworkInfo netInfo = cm.getActiveNetworkInfo();
+ return (netInfo != null && netInfo.isConnected());
+ }
+}
+```
+
+
+
+
+```kotlin
+import android.app.ActivityManager
+import android.app.ActivityManager.RunningAppProcessInfo
+import android.content.BroadcastReceiver
+import android.content.Context
+import android.content.Intent
+import android.net.ConnectivityManager
+import android.net.NetworkCapabilities
+import android.os.Build
+import com.facebook.react.HeadlessJsTaskService
+
+class NetworkChangeReceiver : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent?) {
+ /**
+ * This part will be called every time network connection is changed e.g. Connected -> Not
+ * Connected
+ */
+ if (!isAppOnForeground(context)) {
+ /** We will start our service and send extra info about network connections */
+ val hasInternet = isNetworkAvailable(context)
+ val serviceIntent = Intent(context, MyTaskService::class.java)
+ serviceIntent.putExtra("hasInternet", hasInternet)
+ context.startService(serviceIntent)
+ HeadlessJsTaskService.acquireWakeLockNow(context)
+ }
+ }
+
+ private fun isAppOnForeground(context: Context): Boolean {
+ /**
+ * We need to check if app is in foreground otherwise the app will crash.
+ * http://stackoverflow.com/questions/8489993/check-android-application-is-in-foreground-or-not
+ */
+ val activityManager = context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
+ val appProcesses = activityManager.runningAppProcesses ?: return false
+ val packageName: String = context.getPackageName()
+ for (appProcess in appProcesses) {
+ if (appProcess.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
+ appProcess.processName == packageName
+ ) {
+ return true
+ }
+ }
+ return false
+ }
+
+ companion object {
+ fun isNetworkAvailable(context: Context): Boolean {
+ val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
+ var result = false
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+ val networkCapabilities = cm.activeNetwork ?: return false
+
+ val actNw = cm.getNetworkCapabilities(networkCapabilities) ?: return false
+
+ result =
+ when {
+ actNw.hasTransport(NetworkCapabilities.TRANSPORT_WIFI) -> true
+ actNw.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR) -> true
+ actNw.hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET) -> true
+ else -> false
+ }
+
+ return result
+ } else {
+ cm.run {
+ // deprecated in API level 29
+ cm.activeNetworkInfo?.run {
+ result =
+ when (type) {
+ ConnectivityManager.TYPE_WIFI -> true
+ ConnectivityManager.TYPE_MOBILE -> true
+ ConnectivityManager.TYPE_ETHERNET -> true
+ else -> false
+ }
+ }
+ }
+ }
+ return result
+ }
+ }
+}
+
+```
+
+
+
+
+[0]: https://developer.android.com/reference/android/content/Context.html#startService(android.content.Intent)
diff --git a/website/versioned_docs/version-0.70/height-and-width.md b/website/versioned_docs/version-0.70/height-and-width.md
new file mode 100644
index 00000000000..2319c44dd48
--- /dev/null
+++ b/website/versioned_docs/version-0.70/height-and-width.md
@@ -0,0 +1,98 @@
+---
+id: height-and-width
+title: Height and Width
+---
+
+A component's height and width determine its size on the screen.
+
+## Fixed Dimensions
+
+The general way to set the dimensions of a component is by adding a fixed `width` and `height` to style. All dimensions in React Native are unitless, and represent density-independent pixels.
+
+```SnackPlayer name=Height%20and%20Width
+import React from 'react';
+import { View } from 'react-native';
+
+const FixedDimensionsBasics = () => {
+ return (
+
+
+
+
+
+ );
+};
+
+export default FixedDimensionsBasics;
+```
+
+Setting dimensions this way is common for components whose size should always be fixed to a number of points and not calculated based on screen size.
+
+:::caution
+There is no universal mapping from points to physical units of measurement. This means that a component with fixed dimensions might not have the same physical size, across different devices and screen sizes. However, this difference is unnoticeable for most use cases.
+:::
+
+## Flex Dimensions
+
+Use `flex` in a component's style to have the component expand and shrink dynamically based on available space. Normally you will use `flex: 1`, which tells a component to fill all available space, shared evenly amongst other components with the same parent. The larger the `flex` given, the higher the ratio of space a component will take compared to its siblings.
+
+:::info
+A component can only expand to fill available space if its parent has dimensions greater than `0`. If a parent does not have either a fixed `width` and `height` or `flex`, the parent will have dimensions of `0` and the `flex` children will not be visible.
+:::
+
+```SnackPlayer name=Flex%20Dimensions
+import React from 'react';
+import { View } from 'react-native';
+
+const FlexDimensionsBasics = () => {
+ return (
+ // Try removing the `flex: 1` on the parent View.
+ // The parent will not have dimensions, so the children can't expand.
+ // What if you add `height: 300` instead of `flex: 1`?
+
+
+
+
+
+ );
+};
+
+export default FlexDimensionsBasics;
+```
+
+After you can control a component's size, the next step is to [learn how to lay it out on the screen](flexbox.md).
+
+## Percentage Dimensions
+
+If you want to fill a certain portion of the screen, but you _don't_ want to use the `flex` layout, you _can_ use **percentage values** in the component's style. Similar to flex dimensions, percentage dimensions require parent with a defined size.
+
+```SnackPlayer name=Percentage%20Dimensions
+import React from 'react';
+import { View } from 'react-native';
+
+const PercentageDimensionsBasics = () => {
+ // Try removing the `height: '100%'` on the parent View.
+ // The parent will not have dimensions, so the children can't expand.
+ return (
+
+
+
+
+
+ );
+};
+
+export default PercentageDimensionsBasics;
+```
diff --git a/website/versioned_docs/version-0.70/hermes.md b/website/versioned_docs/version-0.70/hermes.md
new file mode 100644
index 00000000000..cd6b6c9eaf4
--- /dev/null
+++ b/website/versioned_docs/version-0.70/hermes.md
@@ -0,0 +1,159 @@
+---
+id: hermes
+title: Using Hermes
+---
+
+import M1Cocoapods from './\_markdown-m1-cocoapods.mdx';
+
+
+
+
+
+[Hermes](https://hermesengine.dev) is an open-source JavaScript engine optimized for React Native. For many apps, enabling Hermes will result in improved start-up time, decreased memory usage, and smaller app size. At this time Hermes is an **opt-in** React Native feature, and this guide explains how to enable it.
+
+First, ensure you're using at least version 0.60.4 of React Native.
+
+If you have an existing app based on an earlier version of React Native, you will have to upgrade it first. See [Upgrading to new React Native Versions](/docs/upgrading) for how to do this. After upgrading the app, make sure everything works before trying to switch to Hermes.
+
+:::caution Note for React Native compatibility
+Each Hermes release is aimed at a specific RN version. The rule of thumb is to always follow [Hermes releases](https://github.com/facebook/hermes/releases) strictly.
+Version mismatch can result in instant crash of your apps in the worst case scenario.
+:::
+
+:::info Note for Windows users
+Hermes requires [Microsoft Visual C++ 2015 Redistributable](https://www.microsoft.com/en-us/download/details.aspx?id=48145).
+:::
+
+## Enabling Hermes
+
+### Android
+
+Edit your `android/app/build.gradle` file and make the change illustrated below:
+
+```diff
+ project.ext.react = [
+ entryFile: "index.js",
+- enableHermes: false // clean and rebuild if changing
++ enableHermes: true // clean and rebuild if changing
+ ]
+```
+
+Also, if you're using ProGuard, you will need to add these rules in `proguard-rules.pro` :
+
+```
+-keep class com.facebook.hermes.unicode.** { *; }
+-keep class com.facebook.jni.** { *; }
+```
+
+Next, if you've already built your app at least once, clean the build:
+
+```shell
+$ cd android && ./gradlew clean
+```
+
+That's it! You should now be able to develop and deploy your app as usual:
+
+```shell
+$ npx react-native run-android
+```
+
+:::note Note about Android App Bundles
+Android app bundles are supported from React Native 0.62 and up.
+:::
+
+### iOS
+
+Since React Native 0.64, Hermes also runs on iOS. To enable Hermes for iOS, edit your `ios/Podfile` file and make the change illustrated below:
+
+```diff
+ use_react_native!(
+ :path => config[:reactNativePath],
+ # to enable hermes on iOS, change `false` to `true` and then install pods
+ # By default, Hermes is disabled on Old Architecture, and enabled on New Architecture.
+ # You can enable/disable it manually by replacing `flags[:hermes_enabled]` with `true` or `false`.
+- :hermes_enabled => flags[:hermes_enabled],
++ :hermes_enabled => true
+ )
+```
+
+By default, you will be using Hermes if you're on the New Architecture. By specifying a value such
+as `true` or `false` you can enable/disable Hermes as you wish.
+
+Once you've configured it, you can install the Hermes pods with:
+
+```shell
+$ cd ios && pod install
+```
+
+
+
+That's it! You should now be able to develop and deploy your app as usual:
+
+```shell
+$ npx react-native run-ios
+```
+
+## Confirming Hermes is in use
+
+If you've recently created a new app from scratch, you should see if Hermes is enabled in the welcome view:
+
+
+
+A `HermesInternal` global variable will be available in JavaScript that can be used to verify that Hermes is in use:
+
+```jsx
+const isHermes = () => !!global.HermesInternal;
+```
+
+:::caution
+If you are using a non-standard way of loading the JS bundle, it is possible that the `HermesInternal` variable is available but you aren't using the highly optimised pre-compiled bytecode.
+Confirm that you are using the `.hbc` file and also benchmark the before/after as detailed below.
+:::
+
+To see the benefits of Hermes, try making a release build/deployment of your app to compare. For example:
+
+```shell
+$ npx react-native run-android --variant release
+```
+
+or for iOS:
+
+```shell
+$ npx react-native run-ios --configuration Release
+```
+
+This will compile JavaScript to bytecode during build time which will improve your app's startup speed on device.
+
+## Bundled Hermes
+
+Starting with React Native 0.69.0, every version of React Native will come with a **bundled version** of Hermes.
+We will be building a version of Hermes for you whenever we release a new version of React Native. This will make sure you're consuming a version of Hermes which is fully compatible with the version of React Native you're using.
+
+Historically, we had problems with matching versions of Hermes with versions of React Native. This fully eliminates this problem, and offers users a JS engine that is compatible with the specific React Native version.
+
+This change is fully transparent to users of React Native. You can still enable/disable Hermes using the command described in this page.
+You can [read more about the technical implementation on this page](/architecture/bundled-hermes).
+
+## Debugging JS on Hermes using Google Chrome's DevTools
+
+Hermes supports the Chrome debugger by implementing the Chrome inspector protocol. This means Chrome's tools can be used to directly debug JavaScript running on Hermes, on an emulator or on a real, physical, device.
+
+:::info
+Note that this is very different with the "Remote JS Debugging" from the In-App Developer Menu documented in the [Debugging](debugging#debugging-using-a-custom-javascript-debugger) section, which actually runs the JS code on Chrome's V8 on your development machine (laptop or desktop).
+:::
+
+Chrome connects to Hermes running on device via Metro, so you'll need to know where Metro is listening. Typically this will be on `localhost:8081`, but this is [configurable](https://facebook.github.io/metro/docs/configuration). When running `yarn start` the address is written to stdout on startup.
+
+Once you know where the Metro server is listening, you can connect with Chrome using the following steps:
+
+1. Navigate to `chrome://inspect` in a Chrome browser instance.
+
+2. Use the `Configure...` button to add the Metro server address (typically `localhost:8081` as described above).
+
+
+
+
+
+3. You should now see a "Hermes React Native" target with an "inspect" link which can be used to bring up debugger. If you don't see the "inspect" link, make sure the Metro server is running. 
+
+4. You can now use the Chrome debug tools. For example, to breakpoint the next time some JavaScript is run, click on the pause button and trigger an action in your app which would cause JavaScript to execute. 
diff --git a/website/versioned_docs/version-0.70/image-style-props.md b/website/versioned_docs/version-0.70/image-style-props.md
new file mode 100644
index 00000000000..76fac320948
--- /dev/null
+++ b/website/versioned_docs/version-0.70/image-style-props.md
@@ -0,0 +1,627 @@
+---
+id: image-style-props
+title: Image Style Props
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+## Examples
+
+### Image Resize Mode
+
+
+
+
+```SnackPlayer name=Image%20Resize%20Modes%20Function%20Component%20Example
+import React from "react";
+import { View, Image, Text, StyleSheet } from "react-native";
+
+const DisplayAnImageWithStyle = () => {
+ return (
+
+
+
+ resizeMode : cover
+
+
+
+ resizeMode : contain
+
+
+
+ resizeMode : stretch
+
+
+
+ resizeMode : repeat
+
+
+
+ resizeMode : center
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "space-around",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+```SnackPlayer name=Image%20Resize%20Modes%20Class%20Component%20Example
+import React, { Component } from "react";
+import { View, Image, StyleSheet, Text } from "react-native";
+
+class DisplayAnImageWithStyle extends Component {
+ render() {
+ return (
+
+
+
+ resizeMode : cover
+
+
+
+ resizeMode : contain
+
+
+
+ resizeMode : stretch
+
+
+
+ resizeMode : repeat
+
+
+
+ resizeMode : center
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "space-around",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+### Image Border
+
+
+
+
+```SnackPlayer name=Style%20BorderWidth%20and%20BorderColor%20Function%20Component%20Example
+import React from "react";
+import { View, Image, StyleSheet, Text } from "react-native";
+
+const DisplayAnImageWithStyle = () => {
+ return (
+
+
+ borderColor & borderWidth
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+```SnackPlayer name=Style%20BorderWidth%20and%20BorderColor%20Class%20Component%20Example
+import React, { Component } from "react";
+import { View, Image, StyleSheet, Text } from "react-native";
+
+class DisplayAnImageWithStyle extends Component {
+ render() {
+ return (
+
+
+ borderColor & borderWidth
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+### Image Border Radius
+
+
+
+
+```SnackPlayer name=Style%20Border%20Radius%20Function%20Component%20Example
+import React from "react";
+import { View, Image, StyleSheet, Text } from "react-native";
+
+const DisplayAnImageWithStyle = () => {
+ return (
+
+
+
+ borderTopRightRadius
+
+
+
+ borderBottomRightRadius
+
+
+
+ borderBottomLeftRadius
+
+
+
+ borderTopLeftRadius
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "space-around",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+```SnackPlayer name=Style%20Border%20Radius%20Class%20Component%20Example
+import React, { Component } from "react";
+import { View, Image, StyleSheet, Text } from "react-native";
+
+class DisplayAnImageWithStyle extends Component {
+ render() {
+ return (
+
+
+
+ borderTopRightRadius
+
+
+
+ borderBottomRightRadius
+
+
+
+ borderBottomLeftRadius
+
+
+
+ borderTopLeftRadius
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "space-around",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+### Image Tint
+
+
+
+
+```SnackPlayer name=Style%20tintColor%20Function%20Component
+import React from "react";
+import { View, Image, StyleSheet, Text } from "react-native";
+
+const DisplayAnImageWithStyle = () => {
+ return (
+
+
+ tintColor
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+```SnackPlayer name=Style%20tintColor%20Class%20Component
+import React, { Component } from "react";
+import { View, Image, StyleSheet, Text } from "react-native";
+
+class DisplayAnImageWithStyle extends Component {
+ render() {
+ return (
+
+
+ tintColor
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ display: "flex",
+ flexDirection: "vertical",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100%",
+ textAlign: "center"
+ }
+});
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+# Reference
+
+## Props
+
+### `backfaceVisibility`
+
+The property defines whether or not the back face of a rotated image should be visible.
+
+| Type | Default |
+| ----------------------------- | ----------- |
+| enum(`'visible'`, `'hidden'`) | `'visible'` |
+
+---
+
+### `backgroundColor`
+
+| Type |
+| ------------------ |
+| [color](colors.md) |
+
+---
+
+### `borderBottomLeftRadius`
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `borderBottomRightRadius`
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `borderColor`
+
+| Type |
+| ------------------ |
+| [color](colors.md) |
+
+---
+
+### `borderRadius`
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `borderTopLeftRadius`
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `borderTopRightRadius`
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `borderWidth`
+
+| Type |
+| ------ |
+| number |
+
+---
+
+### `opacity`
+
+Set an opacity value for the image. The number should be in the range from `0.0` to `1.0`.
+
+| Type | Default |
+| ------ | ------- |
+| number | `1.0` |
+
+---
+
+### `overflow`
+
+| Type | Default |
+| ----------------------------- | ----------- |
+| enum(`'visible'`, `'hidden'`) | `'visible'` |
+
+---
+
+### `overlayColor`
Android
+
+When the image has rounded corners, specifying an overlayColor will cause the remaining space in the corners to be filled with a solid color. This is useful in cases which are not supported by the Android implementation of rounded corners:
+
+- Certain resize modes, such as `'contain'`
+- Animated GIFs
+
+A typical way to use this prop is with images displayed on a solid background and setting the `overlayColor` to the same color as the background.
+
+For details of how this works under the hood, see [Fresco documentation](https://frescolib.org/docs/rounded-corners-and-circles.html).
+
+| Type |
+| ------ |
+| string |
+
+---
+
+### `resizeMode`
+
+| Type | Default |
+| ----------------------------------------------------------------- | --------- |
+| enum(`'cover'`, `'contain'`, `'stretch'`, `'repeat'`, `'center'`) | `'cover'` |
+
+---
+
+### `tintColor`
+
+Changes the color of all the non-transparent pixels to the tintColor.
+
+| Type |
+| ------------------ |
+| [color](colors.md) |
diff --git a/website/versioned_docs/version-0.70/image.md b/website/versioned_docs/version-0.70/image.md
new file mode 100644
index 00000000000..82c8349770f
--- /dev/null
+++ b/website/versioned_docs/version-0.70/image.md
@@ -0,0 +1,616 @@
+---
+id: image
+title: Image
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+A React component for displaying different types of images, including network images, static resources, temporary local images, and images from local disk, such as the camera roll.
+
+This example shows fetching and displaying an image from local storage as well as one from network and even from data provided in the `'data:'` uri scheme.
+
+> Note that for network and data images, you will need to manually specify the dimensions of your image!
+
+## Examples
+
+
+
+
+```SnackPlayer name=Function%20Component%20Example
+
+import React from 'react';
+import { View, Image, StyleSheet } from 'react-native';
+
+const styles = StyleSheet.create({
+ container: {
+ paddingTop: 50,
+ },
+ tinyLogo: {
+ width: 50,
+ height: 50,
+ },
+ logo: {
+ width: 66,
+ height: 58,
+ },
+});
+
+const DisplayAnImage = () => {
+ return (
+
+
+
+
+
+ );
+}
+
+export default DisplayAnImage;
+```
+
+
+
+
+```SnackPlayer name=Class%20Component%20Example
+
+import React, { Component } from 'react';
+import { AppRegistry, View, Image, StyleSheet } from 'react-native';
+
+const styles = StyleSheet.create({
+ container: {
+ paddingTop: 50,
+ },
+ tinyLogo: {
+ width: 50,
+ height: 50,
+ },
+ logo: {
+ width: 66,
+ height: 58,
+ },
+});
+
+class DisplayAnImage extends Component {
+ render() {
+ return (
+
+
+
+
+
+ );
+ }
+}
+
+export default DisplayAnImage;
+```
+
+
+
+
+You can also add `style` to an image:
+
+
+
+
+```SnackPlayer name=Function%20Component%20Example
+
+import React from 'react';
+import { View, Image, StyleSheet } from 'react-native';
+
+const styles = StyleSheet.create({
+ container: {
+ paddingTop: 50,
+ },
+ stretch: {
+ width: 50,
+ height: 200,
+ resizeMode: 'stretch',
+ },
+});
+
+const DisplayAnImageWithStyle = () => {
+ return (
+
+
+
+ );
+}
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+```SnackPlayer name=Class%20Component%20Example
+
+import React, { Component } from 'react';
+import { View, Image, StyleSheet } from 'react-native';
+
+const styles = StyleSheet.create({
+ stretch: {
+ width: 50,
+ height: 200,
+ resizeMode: 'stretch'
+ }
+});
+
+class DisplayAnImageWithStyle extends Component {
+ render() {
+ return (
+
+
+
+ );
+ }
+}
+
+export default DisplayAnImageWithStyle;
+```
+
+
+
+
+## GIF and WebP support on Android
+
+When building your own native code, GIF and WebP are not supported by default on Android.
+
+You will need to add some optional modules in `android/app/build.gradle`, depending on the needs of your app.
+
+```groovy
+dependencies {
+ // If your app supports Android versions before Ice Cream Sandwich (API level 14)
+ implementation 'com.facebook.fresco:animated-base-support:1.3.0'
+
+ // For animated GIF support
+ implementation 'com.facebook.fresco:animated-gif:2.5.0'
+
+ // For WebP support, including animated WebP
+ implementation 'com.facebook.fresco:animated-webp:2.5.0'
+ implementation 'com.facebook.fresco:webpsupport:2.5.0'
+
+ // For WebP support, without animations
+ implementation 'com.facebook.fresco:webpsupport:2.5.0'
+}
+```
+
+> Note: the version listed above may not be updated in time. Please check [`ReactAndroid/gradle.properties`](https://github.com/facebook/react-native/blob/main/ReactAndroid/gradle.properties) in the main repo to see which fresco version is being used in a specific tagged version.
+
+---
+
+# Reference
+
+## Props
+
+### [View Props](view.md#props)
+
+Inherits [View Props](view#props).
+
+---
+
+### `accessible`
+
+When true, indicates the image is an accessibility element.
+
+| Type | Default |
+| ---- | ------- |
+| bool | `false` |
+
+---
+
+### `accessibilityLabel`
+
+The text that's read by the screen reader when the user interacts with the image.
+
+| Type |
+| ------ |
+| string |
+
+---
+
+### `blurRadius`
+
+blurRadius: the blur radius of the blur filter added to the image.
+
+| Type |
+| ------ |
+| number |
+
+> Tip: On IOS, you will need to increase `blurRadius` by more than `5`.
+
+---
+
+### `capInsets`
iOS
+
+When the image is resized, the corners of the size specified by `capInsets` will stay a fixed size, but the center content and borders of the image will be stretched. This is useful for creating resizable rounded buttons, shadows, and other resizable assets. More info in the [official Apple documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/index.html#//apple_ref/occ/instm/UIImage/resizableImageWithCapInsets).
+
+| Type |
+| ------------ |
+| [Rect](rect) |
+
+---
+
+### `defaultSource`
+
+A static image to display while loading the image source.
+
+| Type |
+| -------------------------------- |
+| [ImageSource](image#imagesource) |
+
+> **Note:** On Android, the default source prop is ignored on debug builds.
+
+---
+
+### `fadeDuration`
Android
+
+Fade animation duration in miliseconds.
+
+| Type | Default |
+| ------ | ------- |
+| number | `300` |
+
+---
+
+### `loadingIndicatorSource`
+
+Similarly to `source`, this property represents the resource used to render the loading indicator for the image. The loading indicator is displayed until image is ready to be displayed, typically after the image is downloaded.
+
+| Type |
+| ----------------------------------------------------- |
+| [ImageSource](image#imagesource) (`uri` only), number |
+
+---
+
+### `onError`
+
+Invoked on load error.
+
+| Type |
+| -------------------------------------- |
+| (`{ nativeEvent: { error } }`) => void |
+
+---
+
+### `onLayout`
+
+Invoked on mount and on layout changes.
+
+| Type |
+| ----------------------------------------------------- |
+| ({ nativeEvent: [LayoutEvent](layoutevent) }) => void |
+
+---
+
+### `onLoad`
+
+Invoked when load completes successfully.
+
+**Example:** `onLoad={({nativeEvent: {source: {width, height}}}) => setImageRealSize({width, height})}`
+
+| Type |
+| ----------------------------------------------------------------- |
+| ({ nativeEvent: [ImageLoadEvent](image#imageloadevent) }) => void |
+
+---
+
+### `onLoadEnd`
+
+Invoked when load either succeeds or fails.
+
+| Type |
+| ---------- |
+| () => void |
+
+---
+
+### `onLoadStart`
+
+Invoked on load start.
+
+**Example:** `onLoadStart={() => this.setState({loading: true})}`
+
+| Type |
+| ---------- |
+| () => void |
+
+---
+
+### `onPartialLoad`
iOS
+
+Invoked when a partial load of the image is complete. The definition of what constitutes a "partial load" is loader specific though this is meant for progressive JPEG loads.
+
+| Type |
+| ---------- |
+| () => void |
+
+---
+
+### `onProgress`
+
+Invoked on download progress.
+
+| Type |
+| ---------------------------------------------- |
+| (`{ nativeEvent: { loaded, total } }`) => void |
+
+---
+
+### `progressiveRenderingEnabled`
+
+The mechanism that should be used to resize the image when the image's dimensions differ from the image view's dimensions. Defaults to `auto`.
+
+- `auto`: Use heuristics to pick between `resize` and `scale`.
+
+- `resize`: A software operation which changes the encoded image in memory before it gets decoded. This should be used instead of `scale` when the image is much larger than the view.
+
+- `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is faster (usually hardware accelerated) and produces higher quality images. This should be used if the image is smaller than the view. It should also be used if the image is slightly bigger than the view.
+
+More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing.
+
+| Type | Default |
+| ------------------------------------- | -------- |
+| enum(`'auto'`, `'resize'`, `'scale'`) | `'auto'` |
+
+---
+
+### `resizeMode`
+
+Determines how to resize the image when the frame doesn't match the raw image dimensions. Defaults to `cover`.
+
+- `cover`: Scale the image uniformly (maintain the image's aspect ratio) so that
+
+ - both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding)
+ - at least one dimension of the scaled image will be equal to the corresponding dimension of the view (minus padding)
+
+- `contain`: Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).
+
+- `stretch`: Scale width and height independently, This may change the aspect ratio of the src.
+
+- `repeat`: Repeat the image to cover the frame of the view. The image will keep its size and aspect ratio, unless it is larger than the view, in which case it will be scaled down uniformly so that it is contained in the view.
+
+- `center`: Center the image in the view along both dimensions. If the image is larger than the view, scale it down uniformly so that it is contained in the view.
+
+| Type | Default |
+| ----------------------------------------------------------------- | --------- |
+| enum(`'cover'`, `'contain'`, `'stretch'`, `'repeat'`, `'center'`) | `'cover'` |
+
+---
+
+### `source`
+
+The image source (either a remote URL or a local file resource).
+
+This prop can also contain several remote URLs, specified together with their width and height and potentially with scale/other URI arguments. The native side will then choose the best `uri` to display based on the measured size of the image container. A `cache` property can be added to control how networked request interacts with the local cache. (For more information see [Cache Control for Images](images#cache-control-ios-only)).
+
+The currently supported formats are `png`, `jpg`, `jpeg`, `bmp`, `gif`, `webp`, `psd` (iOS only). In addition, iOS supports several RAW image formats. Refer to Apple's documentation for the current list of supported camera models (for iOS 12, see https://support.apple.com/en-ca/HT208967).
+
+| Type |
+| -------------------------------- |
+| [ImageSource](image#imagesource) |
+
+---
+
+### `style`
+
+| Type |
+| ---------------------------------------------------------------------------------------------------------------------------------------------------- |
+| [Image Style Props](image-style-props#props), [Layout Props](layout-props#props), [Shadow Props](shadow-props#props), [Transforms](transforms#props) |
+
+---
+
+### `testID`
+
+A unique identifier for this element to be used in UI Automation testing scripts.
+
+| Type |
+| ------ |
+| string |
+
+## Methods
+
+### `abortPrefetch()`
| number | Request id as returned by `prefetch()`. |
+
+---
+
+### `getSize()`
+
+```jsx
+Image.getSize(uri, success, [failure]);
+```
+
+Retrieve the width and height (in pixels) of an image prior to displaying it. This method can fail if the image cannot be found, or fails to download.
+
+In order to retrieve the image dimensions, the image may first need to be loaded or downloaded, after which it will be cached. This means that in principle you could use this method to preload images, however it is not optimized for that purpose, and may in future be implemented in a way that does not fully load/download the image data. A proper, supported way to preload images will be provided as a separate API.
+
+**Parameters:**
+
+|
Name
| Type | Description |
+| -------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------- |
+| uri
Required
| string | The location of the image. |
+| success
Required
| function | The function that will be called if the image was successfully found and width and height retrieved. |
+| failure | function | The function that will be called if there was an error, such as failing to retrieve the image. |
+
+---
+
+### `getSizeWithHeaders()`
+
+```jsx
+Image.getSizeWithHeaders(uri, headers, success, [failure]);
+```
+
+Retrieve the width and height (in pixels) of an image prior to displaying it with the ability to provide the headers for the request. This method can fail if the image cannot be found, or fails to download. It also does not work for static image resources.
+
+In order to retrieve the image dimensions, the image may first need to be loaded or downloaded, after which it will be cached. This means that in principle you could use this method to preload images, however it is not optimized for that purpose, and may in future be implemented in a way that does not fully load/download the image data. A proper, supported way to preload images will be provided as a separate API.
+
+**Parameters:**
+
+|
Name
| Type | Description |
+| -------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------- |
+| uri
Required
| string | The location of the image. |
+| headers
Required
| object | The headers for the request. |
+| success
Required
| function | The function that will be called if the image was successfully found and width and height retrieved. |
+| failure | function | The function that will be called if there was an error, such as failing to retrieve the image. |
+
+---
+
+### `prefetch()`
+
+```jsx
+await Image.prefetch(url);
+```
+
+Prefetches a remote image for later use by downloading it to the disk cache. Returns a promise which resolves to a boolean.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ---------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------ |
+| url
Required
| string | The remote location of the image. |
+| callback | function
Android
| The function that will be called with the `requestId`. |
+
+---
+
+### `queryCache()`
+
+```jsx
+await Image.queryCache(urls);
+```
+
+Perform cache interrogation. Returns a promise which resolves to a mapping from URL to cache status, such as "disk", "memory" or "disk/memory". If a requested URL is not in the mapping, it means it's not in the cache.
+
+**Parameters:**
+
+| Name | Type | Description |
+| ----------------------------------------------------- | ----- | ------------------------------------------ |
+| urls
Required
| array | List of image URLs to check the cache for. |
+
+---
+
+### `resolveAssetSource()`
+
+```jsx
+Image.resolveAssetSource(source);
+```
+
+Resolves an asset reference into an object which has the properties `uri`, `width`, and `height`.
+
+**Parameters:**
+
+|
| [ImageSource](image#imagesource), number | A number (opaque type returned by `require('./foo.png')`) or an ImageSource. |
+
+## Type Definitions
+
+### ImageCacheEnum
iOS
+
+Enum which can be used to set the cache handling or stategy for the potentially cached responses.
+
+| Type | Default |
+| ------------------------------------------------------------------ | ----------- |
+| enum(`'default'`, `'reload'`, `'force-cache'`, `'only-if-cached'`) | `'default'` |
+
+- `default`: Use the native platforms default strategy.
+- `reload`: The data for the URL will be loaded from the originating source. No existing cache data should be used to satisfy a URL load request.
+- `force-cache`: The existing cached data will be used to satisfy the request, regardless of its age or expiration date. If there is no existing data in the cache corresponding the request, the data is loaded from the originating source.
+- `only-if-cached`: The existing cache data will be used to satisfy a request, regardless of its age or expiration date. If there is no existing data in the cache corresponding to a URL load request, no attempt is made to load the data from the originating source, and the load is considered to have failed.
+
+### ImageLoadEvent
+
+Object returned in the `onLoad` callback.
+
+| Type |
+| ------ |
+| object |
+
+**Properties:**
+
+| Name | Type | Description |
+| ------ | ------ | ----------------------------------- |
+| source | object | The [source object](#source-object) |
+
+#### Source Object
+
+**Properties:**
+
+| Name | Type | Description |
+| ------ | ------ | ------------------------------------------------------------ |
+| width | number | The width of loaded image. |
+| height | number | The height of loaded image. |
+| uri | string | A string representing the resource identifier for the image. |
+
+### ImageSource
+
+| Type |
+| -------------------------------- |
+| object, array of objects, number |
+
+**Properties (if passing as object or array of objects):**
+
+|
Name
| Type | Description |
+| -------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| uri | string | A string representing the resource identifier for the image, which could be an http address, a local file path, or the name of a static image resource. |
+| width | number | Can be specified if known at build time, in which case the value will be used to set the default `` component dimension. |
+| height | number | Can be specified if known at build time, in which case the value will be used to set the default `` component dimension. |
+| scale | number | Used to indicate the scale factor of the image. Defaults to `1.0` if unspecified, meaning that one image pixel equates to one display point / DIP. |
+| bundle
iOS
| string | The iOS asset bundle which the image is included in. This will default to `[NSBundle mainBundle]` if not set. |
+| method | string | The HTTP Method to use. Defaults to `'GET'` if not specified. |
+| headers | object | An object representing the HTTP headers to send along with the request for a remote image. |
+| body | string | The HTTP body to send with the request. This must be a valid UTF-8 string, and will be sent exactly as specified, with no additional encoding (e.g. URL-escaping or base64) applied. |
+| cache
iOS
| [ImageCacheEnum](image#imagecacheenum-ios) | Determines how the requests handles potentially cached responses. |
+
+**If passing a number:**
+
+- `number` - opaque type returned by something like `require('./image.jpg')`.
diff --git a/website/versioned_docs/version-0.70/imagebackground.md b/website/versioned_docs/version-0.70/imagebackground.md
new file mode 100644
index 00000000000..be2f8f0f0c8
--- /dev/null
+++ b/website/versioned_docs/version-0.70/imagebackground.md
@@ -0,0 +1,83 @@
+---
+id: imagebackground
+title: ImageBackground
+---
+
+A common feature request from developers familiar with the web is `background-image`. To handle this use case, you can use the `` component, which has the same props as ``, and add whatever children to it you would like to layer on top of it.
+
+You might not want to use `` in some cases, since the implementation is basic. Refer to ``'s [source code](https://github.com/facebook/react-native/blob/master/Libraries/Image/ImageBackground.js) for more insight, and create your own custom component when needed.
+
+Note that you must specify some width and height style attributes.
+
+## Example
+
+```SnackPlayer name=ImageBackground
+import React from "react";
+import { ImageBackground, StyleSheet, Text, View } from "react-native";
+
+const image = { uri: "https://reactjs.org/logo-og.png" };
+
+const App = () => (
+
+
+ Inside
+
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ },
+ image: {
+ flex: 1,
+ justifyContent: "center"
+ },
+ text: {
+ color: "white",
+ fontSize: 42,
+ lineHeight: 84,
+ fontWeight: "bold",
+ textAlign: "center",
+ backgroundColor: "#000000c0"
+ }
+});
+
+export default App;
+```
+
+---
+
+# Reference
+
+## Props
+
+### [Image Props](image.md#props)
+
+Inherits [Image Props](image.md#props).
+
+---
+
+### `imageStyle`
+
+| Type |
+| ----------------------------------- |
+| [Image Style](image-style-props.md) |
+
+---
+
+### `imageRef`
+
+Allows to set a reference to the inner `Image` component
+
+| Type |
+| ----------------------------------------------------- |
+| [Ref](https://reactjs.org/docs/refs-and-the-dom.html) |
+
+---
+
+### `style`
+
+| Type |
+| --------------------------------- |
+| [View Style](view-style-props.md) |
diff --git a/website/versioned_docs/version-0.70/imagepickerios.md b/website/versioned_docs/version-0.70/imagepickerios.md
new file mode 100644
index 00000000000..f83c31d8c0c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/imagepickerios.md
@@ -0,0 +1,79 @@
+---
+id: imagepickerios
+title: '🚧 ImagePickerIOS'
+---
+
+> **Deprecated.** Use one of the [community packages](https://reactnative.directory/?search=image+picker) instead.
+
+---
+
+# Reference
+
+## Methods
+
+### `canRecordVideos()`
+
+```jsx
+static canRecordVideos(callback)
+```
+
+---
+
+### `canUseCamera()`
+
+```jsx
+static canUseCamera(callback)
+```
+
+---
+
+### `openCameraDialog()`
+
+```jsx
+static openCameraDialog(config, successCallback, cancelCallback)
+```
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| --------------- | -------- | -------- | ----------- |
+| config | object | No | See below. |
+| successCallback | function | No | See below. |
+| cancelCallback | function | No | See below. |
+
+`config` is an object containing:
+
+- `videoMode` : An optional boolean value that defaults to false.
+
+`successCallback` is an optional callback function that's invoked when the select dialog is opened successfully. It will include the following data:
+
+- `[string, number, number]`
+
+`cancelCallback` is an optional callback function that's invoked when the camera dialog is canceled.
+
+---
+
+### `openSelectDialog()`
+
+```jsx
+static openSelectDialog(config, successCallback, cancelCallback)
+```
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| --------------- | -------- | -------- | ----------- |
+| config | object | No | See below. |
+| successCallback | function | No | See below. |
+| cancelCallback | function | No | See below. |
+
+`config` is an object containing:
+
+- `showImages` : An optional boolean value that defaults to false.
+- `showVideos`: An optional boolean value that defaults to false.
+
+`successCallback` is an optional callback function that's invoked when the select dialog is opened successfully. It will include the following data:
+
+- `[string, number, number]`
+
+`cancelCallback` is an optional callback function that's invoked when the select dialog is canceled.
diff --git a/website/versioned_docs/version-0.70/images.md b/website/versioned_docs/version-0.70/images.md
new file mode 100644
index 00000000000..5dc1a1af733
--- /dev/null
+++ b/website/versioned_docs/version-0.70/images.md
@@ -0,0 +1,248 @@
+---
+id: images
+title: Images
+---
+
+## Static Image Resources
+
+React Native provides a unified way of managing images and other media assets in your Android and iOS apps. To add a static image to your app, place it somewhere in your source code tree and reference it like this:
+
+```jsx
+
+```
+
+The image name is resolved the same way JS modules are resolved. In the example above, the bundler will look for `my-icon.png` in the same folder as the component that requires it.
+
+You can use the `@2x` and `@3x` suffixes to provide images for different screen densities. If you have the following file structure:
+
+```
+.
+├── button.js
+└── img
+ ├── check.png
+ ├── check@2x.png
+ └── check@3x.png
+```
+
+...and `button.js` code contains:
+
+```jsx
+
+```
+
+...the bundler will bundle and serve the image corresponding to device's screen density. For example, `check@2x.png`, will be used on an iPhone 7, while`check@3x.png` will be used on an iPhone 7 Plus or a Nexus 5. If there is no image matching the screen density, the closest best option will be selected.
+
+On Windows, you might need to restart the bundler if you add new images to your project.
+
+Here are some benefits that you get:
+
+1. Same system on Android and iOS.
+2. Images live in the same folder as your JavaScript code. Components are self-contained.
+3. No global namespace, i.e. you don't have to worry about name collisions.
+4. Only the images that are actually used will be packaged into your app.
+5. Adding and changing images doesn't require app recompilation, you can refresh the simulator as you normally do.
+6. The bundler knows the image dimensions, no need to duplicate it in the code.
+7. Images can be distributed via [npm](https://www.npmjs.com/) packages.
+
+In order for this to work, the image name in `require` has to be known statically.
+
+```jsx
+// GOOD
+;
+
+// BAD
+var icon = this.props.active
+ ? 'my-icon-active'
+ : 'my-icon-inactive';
+;
+
+// GOOD
+var icon = this.props.active
+ ? require('./my-icon-active.png')
+ : require('./my-icon-inactive.png');
+;
+```
+
+Note that image sources required this way include size (width, height) info for the Image. If you need to scale the image dynamically (i.e. via flex), you may need to manually set `{ width: undefined, height: undefined }` on the style attribute.
+
+## Static Non-Image Resources
+
+The `require` syntax described above can be used to statically include audio, video or document files in your project as well. Most common file types are supported including `.mp3`, `.wav`, `.mp4`, `.mov`, `.html` and `.pdf`. See [bundler defaults](https://github.com/facebook/metro/blob/master/packages/metro-config/src/defaults/defaults.js#L14-L44) for the full list.
+
+You can add support for other types by adding an [`assetExts` resolver option](https://facebook.github.io/metro/docs/configuration#resolver-options) in your [Metro configuration](https://facebook.github.io/metro/docs/configuration).
+
+A caveat is that videos must use absolute positioning instead of `flexGrow`, since size info is not currently passed for non-image assets. This limitation doesn't occur for videos that are linked directly into Xcode or the Assets folder for Android.
+
+## Images From Hybrid App's Resources
+
+If you are building a hybrid app (some UIs in React Native, some UIs in platform code) you can still use images that are already bundled into the app.
+
+For images included via Xcode asset catalogs or in the Android drawable folder, use the image name without the extension:
+
+```jsx
+
+```
+
+For images in the Android assets folder, use the `asset:/` scheme:
+
+```jsx
+
+```
+
+These approaches provide no safety checks. It's up to you to guarantee that those images are available in the application. Also you have to specify image dimensions manually.
+
+## Network Images
+
+Many of the images you will display in your app will not be available at compile time, or you will want to load some dynamically to keep the binary size down. Unlike with static resources, _you will need to manually specify the dimensions of your image_. It's highly recommended that you use https as well in order to satisfy [App Transport Security](publishing-to-app-store.md#1-enable-app-transport-security) requirements on iOS.
+
+```jsx
+// GOOD
+
+
+// BAD
+
+```
+
+### Network Requests for Images
+
+If you would like to set such things as the HTTP-Verb, Headers or a Body along with the image request, you may do this by defining these properties on the source object:
+
+```jsx
+
+```
+
+## Uri Data Images
+
+Sometimes, you might be getting encoded image data from a REST API call. You can use the `'data:'` uri scheme to use these images. Same as for network resources, _you will need to manually specify the dimensions of your image_.
+
+:::info
+This is recommended for very small and dynamic images only, like icons in a list from a DB.
+:::
+
+```jsx
+// include at least width and height!
+
+```
+
+### Cache Control (iOS Only)
+
+In some cases you might only want to display an image if it is already in the local cache, i.e. a low resolution placeholder until a higher resolution is available. In other cases you do not care if the image is outdated and are willing to display an outdated image to save bandwidth. The `cache` source property gives you control over how the network layer interacts with the cache.
+
+- `default`: Use the native platforms default strategy.
+- `reload`: The data for the URL will be loaded from the originating source. No existing cache data should be used to satisfy a URL load request.
+- `force-cache`: The existing cached data will be used to satisfy the request, regardless of its age or expiration date. If there is no existing data in the cache corresponding the request, the data is loaded from the originating source.
+- `only-if-cached`: The existing cache data will be used to satisfy a request, regardless of its age or expiration date. If there is no existing data in the cache corresponding to a URL load request, no attempt is made to load the data from the originating source, and the load is considered to have failed.
+
+```jsx
+
+```
+
+## Local Filesystem Images
+
+See [CameraRoll](https://github.com/react-native-community/react-native-cameraroll) for an example of using local resources that are outside of `Images.xcassets`.
+
+### Best Camera Roll Image
+
+iOS saves multiple sizes for the same image in your Camera Roll, it is very important to pick the one that's as close as possible for performance reasons. You wouldn't want to use the full quality 3264x2448 image as source when displaying a 200x200 thumbnail. If there's an exact match, React Native will pick it, otherwise it's going to use the first one that's at least 50% bigger in order to avoid blur when resizing from a close size. All of this is done by default so you don't have to worry about writing the tedious (and error prone) code to do it yourself.
+
+## Why Not Automatically Size Everything?
+
+_In the browser_ if you don't give a size to an image, the browser is going to render a 0x0 element, download the image, and then render the image based with the correct size. The big issue with this behavior is that your UI is going to jump all around as images load, this makes for a very bad user experience.
+
+_In React Native_ this behavior is intentionally not implemented. It is more work for the developer to know the dimensions (or aspect ratio) of the remote image in advance, but we believe that it leads to a better user experience. Static images loaded from the app bundle via the `require('./my-icon.png')` syntax _can be automatically sized_ because their dimensions are available immediately at the time of mounting.
+
+For example, the result of `require('./my-icon.png')` might be:
+
+```jsx
+{"__packager_asset":true,"uri":"my-icon.png","width":591,"height":573}
+```
+
+## Source as an object
+
+In React Native, one interesting decision is that the `src` attribute is named `source` and doesn't take a string but an object with a `uri` attribute.
+
+```jsx
+
+```
+
+On the infrastructure side, the reason is that it allows us to attach metadata to this object. For example if you are using `require('./my-icon.png')`, then we add information about its actual location and size (don't rely on this fact, it might change in the future!). This is also future proofing, for example we may want to support sprites at some point, instead of outputting `{uri: ...}`, we can output `{uri: ..., crop: {left: 10, top: 50, width: 20, height: 40}}` and transparently support spriting on all the existing call sites.
+
+On the user side, this lets you annotate the object with useful attributes such as the dimension of the image in order to compute the size it's going to be displayed in. Feel free to use it as your data structure to store more information about your image.
+
+## Background Image via Nesting
+
+A common feature request from developers familiar with the web is `background-image`. To handle this use case, you can use the `` component, which has the same props as ``, and add whatever children to it you would like to layer on top of it.
+
+You might not want to use `` in some cases, since the implementation is basic. Refer to ``'s [documentation](imagebackground.md) for more insight, and create your own custom component when needed.
+
+```jsx
+return (
+
+ Inside
+
+);
+```
+
+Note that you must specify some width and height style attributes.
+
+## iOS Border Radius Styles
+
+Please note that the following corner specific, border radius style properties might be ignored by iOS's image component:
+
+- `borderTopLeftRadius`
+- `borderTopRightRadius`
+- `borderBottomLeftRadius`
+- `borderBottomRightRadius`
+
+## Off-thread Decoding
+
+Image decoding can take more than a frame-worth of time. This is one of the major sources of frame drops on the web because decoding is done in the main thread. In React Native, image decoding is done in a different thread. In practice, you already need to handle the case when the image is not downloaded yet, so displaying the placeholder for a few more frames while it is decoding does not require any code change.
+
+## Configuring iOS Image Cache Limits
+
+On iOS, we expose an API to override React Native's default image cache limits. This should be called from within your native AppDelegate code (e.g. within `didFinishLaunchingWithOptions`).
+
+```objectivec
+RCTSetImageCacheLimits(4*1024*1024, 200*1024*1024);
+```
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| -------------- | ------ | -------- | ----------------------- |
+| imageSizeLimit | number | Yes | Image cache size limit. |
+| totalCostLimit | number | Yes | Total cache cost limit. |
+
+In the above code example the image size limit is set to 4 MB and the total cost limit is set to 200 MB.
diff --git a/website/versioned_docs/version-0.70/improvingux.md b/website/versioned_docs/version-0.70/improvingux.md
new file mode 100644
index 00000000000..a461d08a11e
--- /dev/null
+++ b/website/versioned_docs/version-0.70/improvingux.md
@@ -0,0 +1,382 @@
+---
+id: improvingux
+title: Improving User Experience
+---
+
+## Configure text inputs
+
+Entering text on touch phone is a challenge - small screen, software keyboard. But based on what kind of data you need, you can make it easier by properly configuring the text inputs:
+
+- Focus the first field automatically
+- Use placeholder text as an example of expected data format
+- Enable or disable autocapitalization and autocorrect
+- Choose keyboard type (e.g. email, numeric)
+- Make sure the return button focuses the next field or submits the form
+
+Check out [`TextInput` docs](textinput.md) for more configuration options.
+
+```SnackPlayer name=TextInput%20form%20example
+import React, { useState, useRef } from 'react';
+import { Text, StatusBar, TextInput, View, StyleSheet } from 'react-native';
+import { Constants } from 'expo';
+
+const App = () => {
+ const emailInput = useRef(null);
+ const [name, setName] = useState('');
+ const [email, setEmail] = useState('');
+
+ const submit = () => {
+ alert(`Welcome, ${name}! Confirmation email has been sent to ${email}`);
+ };
+
+ return (
+
+
+
+
+ This demo shows how using available TextInput customizations can make
+ forms much easier to use. Try completing the form and notice that
+ different fields have specific optimizations and the return key
+ changes from focusing next input to submitting the form.
+
+
+ setName(name)}
+ placeholder="Full Name"
+ autoFocus={true}
+ autoCapitalize="words"
+ autoCorrect={true}
+ keyboardType="default"
+ returnKeyType="next"
+ onSubmitEditing={() => emailInput.current.focus()}
+ blurOnSubmit={false}
+ />
+ setEmail(email)}
+ ref={emailInput}
+ placeholder="email@example.com"
+ autoCapitalize="none"
+ autoCorrect={false}
+ keyboardType="email-address"
+ returnKeyType="send"
+ onSubmitEditing={submit}
+ blurOnSubmit={true}
+ />
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ },
+ header: {
+ paddingTop: 64,
+ padding: 20,
+ backgroundColor: '#282c34',
+ },
+ description: {
+ fontSize: 14,
+ color: 'white',
+ },
+ input: {
+ margin: 20,
+ marginBottom: 0,
+ height: 34,
+ paddingHorizontal: 10,
+ borderRadius: 4,
+ borderColor: '#ccc',
+ borderWidth: 1,
+ fontSize: 16,
+ },
+});
+
+export default App;
+```
+
+## Manage layout when keyboard is visible
+
+Software keyboard takes almost half of the screen. If you have interactive elements that can get covered by the keyboard, make sure they are still accessible by using the [`KeyboardAvoidingView` component](keyboardavoidingview.md).
+
+```SnackPlayer name=KeyboardAvoidingView%20example
+import React, { useState, useRef } from 'react';
+import {
+ Text,
+ Button,
+ StatusBar,
+ TextInput,
+ KeyboardAvoidingView,
+ View,
+ StyleSheet,
+} from 'react-native';
+
+const App = () => {
+ const emailInput = useRef(null);
+ const [email, setEmail] = useState('');
+
+ const submit = () => {
+ emailInput.current.blur();
+ alert(`Confirmation email has been sent to ${email}`);
+ };
+
+ return (
+
+
+
+
+ This demo shows how to avoid covering important UI elements with the
+ software keyboard. Focus the email input below and notice that the
+ Sign Up button and the text adjusted positions to make sure they are
+ not hidden under the keyboard.
+
+
+
+ setEmail(email)}
+ ref={emailInput}
+ placeholder="email@example.com"
+ autoCapitalize="none"
+ autoCorrect={false}
+ keyboardType="email-address"
+ returnKeyType="send"
+ onSubmitEditing={submit}
+ blurOnSubmit={true}
+ />
+
+
+ Some important legal fine print here
+
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ },
+ header: {
+ paddingTop: 64,
+ padding: 20,
+ backgroundColor: '#282c34',
+ },
+ description: {
+ fontSize: 14,
+ color: 'white',
+ },
+ input: {
+ margin: 20,
+ marginBottom: 0,
+ height: 34,
+ paddingHorizontal: 10,
+ borderRadius: 4,
+ borderColor: '#ccc',
+ borderWidth: 1,
+ fontSize: 16,
+ },
+ legal: {
+ margin: 10,
+ color: '#333',
+ fontSize: 12,
+ textAlign: 'center',
+ },
+ form: {
+ flex: 1,
+ justifyContent: 'space-between',
+ },
+});
+
+export default App;
+```
+
+## Make tappable areas larger
+
+On mobile phones it's hard to be very precise when pressing buttons. Make sure all interactive elements are 44x44 or larger. One way to do this is to leave enough space for the element, `padding`, `minWidth` and `minHeight` style values can be useful for that. Alternatively, you can use [`hitSlop` prop](touchablewithoutfeedback.md#hitslop) to increase interactive area without affecting the layout. Here's a demo:
+
+```SnackPlayer name=HitSlop%20example
+import React, { Component } from 'react';
+import {
+ Text,
+ StatusBar,
+ TouchableOpacity,
+ View,
+ StyleSheet,
+} from 'react-native';
+
+const App = () => {
+ return (
+
+
+
+
+ This demo shows how using hitSlop can make interactive elements much
+ easier to tap without changing their layout and size. Try pressing
+ each button quickly multiple times and notice which one is easier to
+ hit.
+
+
+
+
+ Without hitSlop
+
+
+
+
+ With hitSlop
+
+
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ },
+ header: {
+ paddingTop: 64,
+ padding: 20,
+ backgroundColor: '#282c34',
+ },
+ description: {
+ fontSize: 14,
+ color: 'white',
+ },
+ content: {
+ flex: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ label: {
+ fontSize: 18,
+ color: '#336699',
+ textAlign: 'center',
+ borderColor: '#ddd',
+ borderWidth: 1,
+ },
+ separator: {
+ height: 50,
+ },
+ preview: {
+ padding: 20,
+ backgroundColor: '#f6f6f6',
+ },
+});
+
+export default App;
+```
+
+## Use Android Ripple
+
+Android API 21+ uses the material design ripple to provide user with feedback when they touch an interactable area on the screen. React Native exposes this through the [`TouchableNativeFeedback` component](touchablenativefeedback.md). Using this touchable effect instead of opacity or highlight will often make your app feel much more fitting on the platform. That said, you need to be careful when using it because it doesn't work on iOS or on Android API < 21, so you will need to fallback to using one of the other Touchable components on iOS. You can use a library like [react-native-platform-touchable](https://github.com/react-community/react-native-platform-touchable) to handle the platform differences for you.
+
+```SnackPlayer name=Android%20Ripple%20example&supportedPlatforms=android
+import React from 'react';
+import {
+ TouchableNativeFeedback,
+ TouchableOpacity,
+ TouchableHighlight,
+ Platform,
+ Text,
+ View,
+ StyleSheet,
+} from 'react-native';
+
+const SUPPORTS_NATIVE_FEEDBACK =
+ Platform.OS === 'android' && Platform.Version >= 21;
+
+const noop = () => {};
+const defaultHitSlop = { top: 15, bottom: 15, right: 15, left: 15 };
+
+const ButtonsWithNativeFeedback = () => (
+
+
+
+ This is a ripple respecting borders
+
+
+
+
+
+ This is ripple without borders, this is more useful for icons, eg: in
+ tab bar
+
+
+
+
+);
+
+const Buttons = () => (
+
+
+ This is opacity
+
+
+ This is highlight
+
+
+);
+
+const App = () => (
+
+ {SUPPORTS_NATIVE_FEEDBACK ? : }
+
+);
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: 'center',
+ justifyContent: 'center',
+ paddingTop: 64,
+ backgroundColor: '#fff',
+ },
+ buttonContainer: {
+ margin: 24,
+ },
+ text: {
+ fontSize: 20,
+ color: '#fff',
+ fontWeight: 'bold',
+ },
+ button: {
+ padding: 25,
+ borderRadius: 5,
+ backgroundColor: '#000',
+ marginBottom: 30,
+ },
+});
+
+export default App;
+```
+
+## Screen orientation lock
+
+Multiple screen orientations should work fine by default unless you're using `Dimensions` API and don't handle orientation changes. If you don't want to support multiple screen orientations, you can lock the screen orientation to either portrait or landscape.
+
+On iOS, in the General tab and Deployment Info section of Xcode enable the Device Orientation you want to support (ensure you have selected iPhone from the Devices menu when making the changes). For Android, open the AndroidManifest.xml file and within the activity element add `'android:screenOrientation="portrait"'` to lock to portrait or `'android:screenOrientation="landscape"'` to lock to landscape.
+
+# Learn more
+
+[Material Design](https://material.io/) and [Human Interface Guidelines](https://developer.apple.com/ios/human-interface-guidelines/overview/design-principles/) are great resources for learning more about designing for mobile platforms.
diff --git a/website/versioned_docs/version-0.70/inputaccessoryview.md b/website/versioned_docs/version-0.70/inputaccessoryview.md
new file mode 100644
index 00000000000..4de484ad34c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/inputaccessoryview.md
@@ -0,0 +1,79 @@
+---
+id: inputaccessoryview
+title: InputAccessoryView
+---
+
+A component which enables customization of the keyboard input accessory view on iOS. The input accessory view is displayed above the keyboard whenever a `TextInput` has focus. This component can be used to create custom toolbars.
+
+To use this component wrap your custom toolbar with the InputAccessoryView component, and set a `nativeID`. Then, pass that `nativeID` as the `inputAccessoryViewID` of whatever `TextInput` you desire. A basic example:
+
+```SnackPlayer name=InputAccessoryView&supportedPlatforms=ios
+import React, { useState } from 'react';
+import { Button, InputAccessoryView, ScrollView, TextInput } from 'react-native';
+
+export default App = () => {
+ const inputAccessoryViewID = 'uniqueID';
+ const initialText = '';
+ const [text, setText] = useState(initialText);
+
+ return (
+ <>
+
+
+
+
+ setText(initialText)}
+ title="Clear text"
+ />
+
+ >
+ );
+}
+```
+
+This component can also be used to create sticky text inputs (text inputs which are anchored to the top of the keyboard). To do this, wrap a `TextInput` with the `InputAccessoryView` component, and don't set a `nativeID`. For an example, look at [InputAccessoryViewExample.js](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/InputAccessoryView/InputAccessoryViewExample.js).
+
+---
+
+# Reference
+
+## Props
+
+### `backgroundColor`
+
+| Type |
+| ------------------ |
+| [color](colors.md) |
+
+---
+
+### `nativeID`
+
+An ID which is used to associate this `InputAccessoryView` to specified TextInput(s).
+
+| Type |
+| ------ |
+| string |
+
+---
+
+### `style`
+
+| Type |
+| --------------------------------- |
+| [View Style](view-style-props.md) |
+
+# Known issues
+
+- [react-native#18997](https://github.com/facebook/react-native/issues/18997): Doesn't support multiline `TextInput`
+- [react-native#20157](https://github.com/facebook/react-native/issues/20157): Can't use with a bottom tab bar
diff --git a/website/versioned_docs/version-0.70/integration-with-android-fragment.md b/website/versioned_docs/version-0.70/integration-with-android-fragment.md
new file mode 100644
index 00000000000..90e49b1cca6
--- /dev/null
+++ b/website/versioned_docs/version-0.70/integration-with-android-fragment.md
@@ -0,0 +1,306 @@
+---
+id: integration-with-android-fragment
+title: Integration with an Android Fragment
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+The guide for [Integration with Existing Apps](https://reactnative.dev/docs/integration-with-existing-apps) details how to integrate a full-screen React Native app into an existing Android app as an Activity. To use React Native components within Fragments in an existing app requires some additional setup. The benefit of this is that it allows for a native app to integrate React Native components alongside native fragments in an Activity.
+
+### 1. Add React Native to your app
+
+Follow the guide for [Integration with Existing Apps](https://reactnative.dev/docs/integration-with-existing-apps) until the Code integration section. Continue to follow Step 1. Create an `index.android.js` file and Step 2. Add your React Native code from this section.
+
+### 2. Integrating your App with a React Native Fragment
+
+You can render your React Native component into a Fragment instead of a full screen React Native Activity. The component may be termed a "screen" or "fragment" and it will function in the same manner as an Android fragment, likely containing child components. These components can be placed in a `/fragments` folder and the child components used to compose the fragment can be placed in a `/components` folder.
+
+You will need to implement the `ReactApplication` interface in your main Application Java/Kotlin class. If you have created a new project from Android Studio with a default activity, you will need to create a new class (e.g. `MyReactApplication.java` or `MyReactApplication.kt`). If it is an existing class you can find this main class in your `AndroidManifest.xml` file. Under the `` tag you should see a property `android:name` e.g. `android:name=".MyReactApplication"`. This value is the class you want to implement and provide the required methods to.
+
+Ensure your main Application class implements ReactApplication:
+
+
+
+
+```kotlin
+class MyReactApplication: Application(), ReactApplication {...}
+```
+
+
+
+
+```java
+public class MyReactApplication extends Application implements ReactApplication {...}
+```
+
+
+
+
+Override the required methods `getUseDeveloperSupport`, `getPackages` and `getReactNativeHost`:
+
+
+
+
+```kotlin
+class MyReactApplication : Application(), ReactApplication {
+ override fun onCreate() {
+ super.onCreate()
+ SoLoader.init(this, false)
+ }
+ private val reactNativeHost =
+ object : ReactNativeHost(this) {
+ override fun getUseDeveloperSupport() = BuildConfig.DEBUG
+ override fun getPackages(): List {
+ val packages = PackageList(this).getPackages().toMutableList()
+ // Packages that cannot be autolinked yet can be added manually here
+ return packages
+ }
+ }
+ override fun getReactNativeHost(): ReactNativeHost = reactNativeHost
+}
+```
+
+
+
+
+```java
+public class MyReactApplication extends Application implements ReactApplication {
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ SoLoader.init(this, false);
+ }
+
+ private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
+ @Override
+ public boolean getUseDeveloperSupport() {
+ return BuildConfig.DEBUG;
+ }
+
+ protected List getPackages() {
+ List packages = new PackageList(this).getPackages();
+ // Packages that cannot be autolinked yet can be added manually here
+ return packages;
+ }
+ };
+
+ @Override
+ public ReactNativeHost getReactNativeHost() {
+ return mReactNativeHost;
+ }
+}
+```
+
+
+
+
+If you are using Android Studio, use Alt + Enter to add all missing imports in your class. Alternatively these are the required imports to include manually:
+
+
+
+
+```kotlin
+import android.app.Application
+
+import com.facebook.react.PackageList
+import com.facebook.react.ReactApplication
+import com.facebook.react.ReactNativeHost
+import com.facebook.react.ReactPackage
+import com.facebook.soloader.SoLoader
+```
+
+
+
+
+```java
+import android.app.Application;
+
+import com.facebook.react.PackageList;
+import com.facebook.react.ReactApplication;
+import com.facebook.react.ReactNativeHost;
+import com.facebook.react.ReactPackage;
+import com.facebook.soloader.SoLoader;
+
+import java.util.List;
+```
+
+
+
+
+Perform a "Sync Project files with Gradle" operation.
+
+### Step 3. Add a FrameLayout for the React Native Fragment
+
+You will now add your React Native Fragment to an Activity. For a new project this Activity will be `MainActivity` but it could be any Activity and more fragments can be added to additional Activities as you integrate more React Native components into your app.
+
+First add the React Native Fragment to your Activity's layout. For example `main_activity.xml` in the `res/layouts` folder.
+
+Add a `` with an id, width and height. This is the layout you will find and render your React Native Fragment into.
+
+```xml
+
+```
+
+### Step 4. Add a React Native Fragment to the FrameLayout
+
+To add your React Native Fragment to your layout you need to have an Activity. As mentioned in a new project this will be `MainActivity`. In this Activity add a button and an event listener. On button click you will render your React Native Fragment.
+
+Modify your Activity layout to add the button:
+
+```xml
+
+```
+
+Now in your Activity class (e.g. `MainActivity.java` or `MainActivity.kt`) you need to add an `OnClickListener` for the button, instantiate your `ReactFragment` and add it to the frame layout.
+
+Add the button field to the top of your Activity:
+
+
+
+
+```kotlin
+private lateinit var button: Button
+```
+
+
+
+
+```java
+private Button mButton;
+```
+
+
+
+
+Update your Activity's `onCreate` method as follows:
+
+
+
+
+```kotlin
+override fun onCreate(savedInstanceState: Bundle) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.main_activity)
+ button = findViewById(R.id.button)
+ button.setOnClickListener {
+ val reactNativeFragment = ReactFragment.Builder()
+ .setComponentName("HelloWorld")
+ .setLaunchOptions(getLaunchOptions("test message"))
+ .build()
+ getSupportFragmentManager()
+ .beginTransaction()
+ .add(R.id.reactNativeFragment, reactNativeFragment)
+ .commit()
+ }
+}
+```
+
+
+
+
+```java
+@Override
+protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.main_activity);
+
+ mButton = findViewById(R.id.button);
+ mButton.setOnClickListener(new View.OnClickListener() {
+ public void onClick(View v) {
+ Fragment reactNativeFragment = new ReactFragment.Builder()
+ .setComponentName("HelloWorld")
+ .setLaunchOptions(getLaunchOptions("test message"))
+ .build();
+
+ getSupportFragmentManager()
+ .beginTransaction()
+ .add(R.id.reactNativeFragment, reactNativeFragment)
+ .commit();
+
+ }
+ });
+}
+```
+
+
+
+
+In the code above `Fragment reactNativeFragment = new ReactFragment.Builder()` creates the ReactFragment and `getSupportFragmentManager().beginTransaction().add()` adds the Fragment to the Frame Layout.
+
+If you are using a starter kit for React Native, replace the "HelloWorld" string with the one in your `index.js` or `index.android.js` file (it’s the first argument to the AppRegistry.registerComponent() method).
+
+Add the `getLaunchOptions` method which will allow you to pass props through to your component. This is optional and you can remove `setLaunchOptions` if you don't need to pass any props.
+
+
+
+
+```kotlin
+private fun getLaunchOptions(message: String) = Bundle().apply {
+ putString("message", message)
+}
+
+```
+
+
+
+
+```java
+private Bundle getLaunchOptions(String message) {
+ Bundle initialProperties = new Bundle();
+ initialProperties.putString("message", message);
+ return initialProperties;
+}
+```
+
+
+
+
+Add all missing imports in your Activity class. Be careful to use your package’s BuildConfig and not the one from the facebook package! Alternatively these are the required imports to include manually:
+
+
+
+
+```kotlin
+import android.app.Application
+
+import com.facebook.react.ReactApplication
+import com.facebook.react.ReactNativeHost
+import com.facebook.react.ReactPackage
+import com.facebook.react.shell.MainReactPackage
+import com.facebook.soloader.SoLoader
+
+```
+
+
+
+
+```java
+import android.app.Application;
+
+import com.facebook.react.ReactApplication;
+import com.facebook.react.ReactNativeHost;
+import com.facebook.react.ReactPackage;
+import com.facebook.react.shell.MainReactPackage;
+import com.facebook.soloader.SoLoader;
+```
+
+
+
+
+Perform a "Sync Project files with Gradle" operation.
+
+### Step 5. Test your integration
+
+Make sure you run `yarn` to install your react-native dependencies and run `yarn native` to start the metro bundler. Run your android app in Android Studio and it should load the JavaScript code from the development server and display it in your React Native Fragment in the Activity.
+
+### Step 6. Additional setup - Native modules
+
+You may need to call out to existing Java/Kotlin code from your react component. Native modules allow you to call out to native code and run methods in your native app. Follow the setup here [native-modules-android](/docs/native-modules-android)
diff --git a/website/versioned_docs/version-0.70/integration-with-existing-apps.md b/website/versioned_docs/version-0.70/integration-with-existing-apps.md
new file mode 100644
index 00000000000..a6df98e1ea3
--- /dev/null
+++ b/website/versioned_docs/version-0.70/integration-with-existing-apps.md
@@ -0,0 +1,38 @@
+---
+id: integration-with-existing-apps
+title: Integration with Existing Apps
+hide_table_of_contents: true
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
+
+import IntegrationJava from './\_integration-with-exisiting-apps-java.md'; import IntegrationObjC from './\_integration-with-exisiting-apps-objc.md'; import IntegrationSwift from './\_integration-with-exisiting-apps-swift.md'; import
+IntegrationKotlin from './\_integration-with-existing-apps-kotlin.md';
+
+React Native is great when you are starting a new mobile app from scratch. However, it also works well for adding a single view or user flow to existing native applications. With a few steps, you can add new React Native based features, screens, views, etc.
+
+The specific steps are different depending on what platform you're targeting.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/website/versioned_docs/version-0.70/interactionmanager.md b/website/versioned_docs/version-0.70/interactionmanager.md
new file mode 100644
index 00000000000..41588b6fb02
--- /dev/null
+++ b/website/versioned_docs/version-0.70/interactionmanager.md
@@ -0,0 +1,228 @@
+---
+id: interactionmanager
+title: InteractionManager
+---
+
+InteractionManager allows long-running work to be scheduled after any interactions/animations have completed. In particular, this allows JavaScript animations to run smoothly.
+
+Applications can schedule tasks to run after interactions with the following:
+
+```jsx
+InteractionManager.runAfterInteractions(() => {
+ // ...long-running synchronous task...
+});
+```
+
+Compare this to other scheduling alternatives:
+
+- requestAnimationFrame(): for code that animates a view over time.
+- setImmediate/setTimeout(): run code later, note this may delay animations.
+- runAfterInteractions(): run code later, without delaying active animations.
+
+The touch handling system considers one or more active touches to be an 'interaction' and will delay `runAfterInteractions()` callbacks until all touches have ended or been cancelled.
+
+InteractionManager also allows applications to register animations by creating an interaction 'handle' on animation start, and clearing it upon completion:
+
+```jsx
+var handle = InteractionManager.createInteractionHandle();
+// run animation... (`runAfterInteractions` tasks are queued)
+// later, on animation completion:
+InteractionManager.clearInteractionHandle(handle);
+// queued tasks run if all handles were cleared
+```
+
+`runAfterInteractions` takes either a plain callback function, or a `PromiseTask` object with a `gen` method that returns a `Promise`. If a `PromiseTask` is supplied, then it is fully resolved (including asynchronous dependencies that also schedule more tasks via `runAfterInteractions`) before starting on the next task that might have been queued up synchronously earlier.
+
+By default, queued tasks are executed together in a loop in one `setImmediate` batch. If `setDeadline` is called with a positive number, then tasks will only be executed until the deadline (in terms of js event loop run time) approaches, at which point execution will yield via setTimeout, allowing events such as touches to start interactions and block queued tasks from executing, making apps more responsive.
+
+---
+
+## Example
+
+### Basic
+
+```SnackPlayer name=InteractionManager%20Function%20Component%20Basic%20Example&supportedPlatforms=ios,android
+import React, { useState, useEffect } from "react";
+import {
+ Alert,
+ Animated,
+ InteractionManager,
+ Platform,
+ StyleSheet,
+ Text,
+ View,
+} from "react-native";
+
+const instructions = Platform.select({
+ ios: "Press Cmd+R to reload,\n" + "Cmd+D or shake for dev menu",
+ android:
+ "Double tap R on your keyboard to reload,\n" +
+ "Shake or press menu button for dev menu",
+});
+
+const useMount = func => useEffect(() => func(), []);
+
+const useFadeIn = (duration = 5000) => {
+ const [opacity] = useState(new Animated.Value(0));
+
+ // Running the animation when the component is mounted
+ useMount(() => {
+ // Animated.timing() create a interaction handle by default, if you want to disabled that
+ // behaviour you can set isInteraction to false to disabled that.
+ Animated.timing(opacity, {
+ toValue: 1,
+ duration,
+ }).start();
+ });
+
+ return opacity;
+};
+
+const Ball = ({ onShown }) => {
+ const opacity = useFadeIn();
+
+ // Running a method after the animation
+ useMount(() => {
+ const interactionPromise = InteractionManager.runAfterInteractions(() => onShown());
+ return () => interactionPromise.cancel();
+ });
+
+ return ;
+};
+
+const App = () => {
+ return (
+
+ {instructions}
+ Alert.alert("Animation is done")} />
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: { flex: 1, justifyContent: "center", alignItems: "center" },
+ ball: {
+ width: 100,
+ height: 100,
+ backgroundColor: "salmon",
+ borderRadius: 100,
+ },
+});
+
+export default App;
+```
+
+### Advanced
+
+```SnackPlayer name=InteractionManager%20Function%20Component%20Advanced%20Example&supportedPlatforms=ios,android
+import React, { useEffect } from "react";
+import {
+ Alert,
+ Animated,
+ InteractionManager,
+ Platform,
+ StyleSheet,
+ Text,
+ View,
+} from "react-native";
+
+const instructions = Platform.select({
+ ios: "Press Cmd+R to reload,\n" + "Cmd+D or shake for dev menu",
+ android:
+ "Double tap R on your keyboard to reload,\n" +
+ "Shake or press menu button for dev menu",
+});
+
+const useMount = func => useEffect(() => func(), []);
+
+// You can create a custom interaction/animation and add
+// support for InteractionManager
+const useCustomInteraction = (timeLocked = 2000) => {
+ useMount(() => {
+ const handle = InteractionManager.createInteractionHandle();
+
+ setTimeout(
+ () => InteractionManager.clearInteractionHandle(handle),
+ timeLocked
+ );
+
+ return () => InteractionManager.clearInteractionHandle(handle);
+ });
+};
+
+const Ball = ({ onInteractionIsDone }) => {
+ useCustomInteraction();
+
+ // Running a method after the interaction
+ useMount(() => {
+ InteractionManager.runAfterInteractions(() => onInteractionIsDone());
+ });
+
+ return ;
+};
+
+const App = () => {
+ return (
+
+ {instructions}
+ Alert.alert("Interaction is done")} />
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: { flex: 1, justifyContent: "center", alignItems: "center" },
+ ball: {
+ width: 100,
+ height: 100,
+ backgroundColor: "salmon",
+ borderRadius: 100,
+ },
+});
+
+export default App;
+```
+
+> **Note**: `InteractionManager.runAfterInteractions()` is not working properly on web. It triggers immediately without waiting until the interaction is finished.
+
+# Reference
+
+## Methods
+
+### `runAfterInteractions()`
+
+```jsx
+static runAfterInteractions(task)
+```
+
+Schedule a function to run after all interactions have completed. Returns a cancellable "promise".
+
+---
+
+### `createInteractionHandle()`
+
+```jsx
+static createInteractionHandle()
+```
+
+Notify manager that an interaction has started.
+
+---
+
+### `clearInteractionHandle()`
+
+```jsx
+static clearInteractionHandle(handle)
+```
+
+Notify manager that an interaction has completed.
+
+---
+
+### `setDeadline()`
+
+```jsx
+static setDeadline(deadline)
+```
+
+A positive number will use setTimeout to schedule any tasks after the eventLoopRunningTime hits the deadline value, otherwise all tasks will be executed in one setImmediate batch (default).
diff --git a/website/versioned_docs/version-0.70/intro-react-native-components.md b/website/versioned_docs/version-0.70/intro-react-native-components.md
new file mode 100644
index 00000000000..00d22878aad
--- /dev/null
+++ b/website/versioned_docs/version-0.70/intro-react-native-components.md
@@ -0,0 +1,84 @@
+---
+id: intro-react-native-components
+title: Core Components and Fabric Components
+description: 'React Native lets you compose app interfaces using Fabric Components. Conveniently, it comes with a set of these components for you to get started with right now—the Core Components!'
+---
+
+import ThemedImage from '@theme/ThemedImage';
+
+React Native is an open source framework for building Android and iOS applications using [React](https://reactjs.org/) and the app platform’s native capabilities. With React Native, you use JavaScript to access your platform’s APIs as well as to describe the appearance and behavior of your UI using React components: bundles of reusable, nestable code. You can learn more about React in the next section. But first, let’s cover how components work in React Native.
+
+## Views and mobile development
+
+In Android and iOS development, a **view** is the basic building block of UI: a small rectangular element on the screen which can be used to display text, images, or respond to user input. Even the smallest visual elements of an app, like a line of text or a button, are kinds of views. Some kinds of views can contain other views. It’s views all the way down!
+
+
+
+ Just a sampling of the many views used in Android and iOS apps.
+
+
+## Fabric Components
+
+In Android development, you write views in Kotlin or Java; in iOS development, you use Swift or Objective-C. With React Native, you can invoke these views with JavaScript using React components. At runtime, React Native creates the corresponding Android and iOS views for those components. Because React Native components are backed by the same views as Android and iOS, React Native apps look, feel, and perform like any other apps. We call these platform-backed components **Fabric Components.** [_Fabric_](architecture/fabric-renderer) is the name of the React Native renderer, therefore components that are rendered via Fabric are called Fabric Components.
+
+React Native comes with a set of essential, ready-to-use Fabric Components you can use to start building your app today. These are React Native's **Core Components**.
+
+React Native also lets you build your own [Fabric Components](the-new-architecture/pillars-fabric-components) to suit your app’s unique needs. We also have a thriving ecosystem of these **community-contributed components.** Check out [Native Directory](https://reactnative.directory) to find what the community has been creating.
+
+## Core Components
+
+React Native has many Core Components for everything form controls to activity indicators. You can find them all [documented in the API section](components-and-apis). You will mostly work with the following Core Components:
+
+| React Native UI Component | Android View | iOS View | Web Analog | Description |
+| ------------------------- | -------------- | ---------------- | ----------------------- | ----------------------------------------------------------------------------------------------------- |
+| `` | `` | `` | A non-scrolling `
` | A container that supports layout with flexbox, style, some touch handling, and accessibility controls |
+| `` | `` | `` | `
` | Displays, styles, and nests strings of text and even handles touch events |
+| `` | `` | `` | `` | Displays different types of images |
+| `` | `` | `` | `
` | A generic scrolling container that can contain multiple components and views |
+| `` | `` | `` | `` | Allows the user to enter text |
+
+In the next section, you will start combining these Core Components to learn about how React works. Have a play with them here now!
+
+```SnackPlayer name=Hello%20World
+import React from 'react';
+import { View, Text, Image, ScrollView, TextInput } from 'react-native';
+
+const App = () => {
+ return (
+
+ Some text
+
+ Some more text
+
+
+
+
+ );
+}
+
+export default App;
+```
+
+---
+
+Because React Native uses the same API structure as React components, you’ll need to understand React component APIs to get started. The [next section](intro-react) makes for a quick introduction or refresher on the topic. However, if you’re already familiar with React, feel free to [skip ahead](handling-text-input).
+
+
diff --git a/website/versioned_docs/version-0.70/intro-react.md b/website/versioned_docs/version-0.70/intro-react.md
new file mode 100644
index 00000000000..80f50eed279
--- /dev/null
+++ b/website/versioned_docs/version-0.70/intro-react.md
@@ -0,0 +1,540 @@
+---
+id: intro-react
+title: React Fundamentals
+description: To understand React Native fully, you need a solid foundation in React. This short introduction to React can help you get started or get refreshed.
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+React Native runs on [React](https://reactjs.org/), a popular open source library for building user interfaces with JavaScript. To make the most of React Native, it helps to understand React itself. This section can get you started or can serve as a refresher course.
+
+We’re going to cover the core concepts behind React:
+
+- components
+- JSX
+- props
+- state
+
+If you want to dig deeper, we encourage you to check out [React’s official documentation](https://reactjs.org/docs/getting-started.html).
+
+## Your first component
+
+The rest of this introduction to React uses cats in its examples: friendly, approachable creatures that need names and a cafe to work in. Here is your very first Cat component:
+
+
+
+
+```SnackPlayer name=Your%20Cat
+import React from 'react';
+import { Text } from 'react-native';
+
+const Cat = () => {
+ return (
+ Hello, I am your cat!
+ );
+}
+
+export default Cat;
+```
+
+Here is how you do it: To define your `Cat` component, first use JavaScript’s [`import`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import) to import React and React Native’s [`Text`](/docs/next/text) Core Component:
+
+```jsx
+import React from 'react';
+import { Text } from 'react-native';
+```
+
+Your component starts as a function:
+
+```jsx
+const Cat = () => {};
+```
+
+You can think of components as blueprints. Whatever a function component returns is rendered as a **React element.** React elements let you describe what you want to see on the screen.
+
+Here the `Cat` component will render a `` element:
+
+```jsx
+const Cat = () => {
+ return Hello, I am your cat!;
+};
+```
+
+You can export your function component with JavaScript’s [`export default`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export) for use throughout your app like so:
+
+```jsx
+const Cat = () => {
+ return Hello, I am your cat!;
+};
+
+export default Cat;
+```
+
+
+
+
+Class components tend to be a bit more verbose than function components.
+
+```SnackPlayer name=Your%20Cat
+import React, { Component } from 'react';
+import { Text } from 'react-native';
+
+class Cat extends Component {
+ render() {
+ return (
+ Hello, I am your cat!
+ );
+ }
+}
+
+export default Cat;
+```
+
+You additionally import `Component` from React:
+
+```jsx
+import React, { Component } from 'react';
+```
+
+Your component starts as a class extending `Component` instead of as a function:
+
+```jsx
+class Cat extends Component {}
+```
+
+Class components have a `render()` function. Whatever is returned inside it is rendered as a React element:
+
+```jsx
+class Cat extends Component {
+ render() {
+ return Hello, I am your cat!;
+ }
+}
+```
+
+And as with function components, you can export your class component:
+
+```jsx
+class Cat extends Component {
+ render() {
+ return Hello, I am your cat!;
+ }
+}
+
+export default Cat;
+```
+
+
+
+
+> This is one of many ways to export your component. This kind of export works well with the Snack Player. However, depending on your app’s file structure, you might need to use a different convention. This [handy cheatsheet on JavaScript imports and exports](https://medium.com/dailyjs/javascript-module-cheatsheet-7bd474f1d829) can help.
+
+Now take a closer look at that `return` statement. `Hello, I am your cat!` is using a kind of JavaScript syntax that makes writing elements convenient: JSX.
+
+## JSX
+
+React and React Native use **JSX,** a syntax that lets you write elements inside JavaScript like so: `Hello, I am your cat!`. The React docs have [a comprehensive guide to JSX](https://reactjs.org/docs/jsx-in-depth.html) you can refer to learn even more. Because JSX is JavaScript, you can use variables inside it. Here you are declaring a name for the cat, `name`, and embedding it with curly braces inside ``.
+
+```SnackPlayer name=Curly%20Braces
+import React from 'react';
+import { Text } from 'react-native';
+
+const Cat = () => {
+ const name = "Maru";
+ return (
+ Hello, I am {name}!
+ );
+}
+
+export default Cat;
+```
+
+Any JavaScript expression will work between curly braces, including function calls like `{getFullName("Rum", "Tum", "Tugger")}`:
+
+```SnackPlayer name=Curly%20Braces
+import React from 'react';
+import { Text } from 'react-native';
+
+const getFullName = (firstName, secondName, thirdName) => {
+ return firstName + " " + secondName + " " + thirdName;
+}
+
+const Cat = () => {
+ return (
+
+ Hello, I am {getFullName("Rum", "Tum", "Tugger")}!
+
+ );
+}
+
+export default Cat;
+```
+
+You can think of curly braces as creating a portal into JS functionality in your JSX!
+
+> Because JSX is included in the React library, it won’t work if you don’t have `import React from 'react'` at the top of your file!
+
+## Custom Components
+
+You’ve already met [React Native’s Core Components](intro-react-native-components). React lets you nest these components inside each other to create new components. These nestable, reusable components are at the heart of the React paradigm.
+
+For example, you can nest [`Text`](text) and [`TextInput`](textinput) inside a [`View`](view) below, and React Native will render them together:
+
+```SnackPlayer name=Custom%20Components
+import React from 'react';
+import { Text, TextInput, View } from 'react-native';
+
+const Cat = () => {
+ return (
+
+ Hello, I am...
+
+
+ );
+}
+
+export default Cat;
+```
+
+#### Developer notes
+
+
+
+
+
+> If you’re familiar with web development, `` and `` might remind you of HTML! You can think of them as the `
` and `
` tags of application development.
+
+
+
+
+> On Android, you usually put your views inside `LinearLayout`, `FrameLayout`, `RelativeLayout`, etc. to define how the view’s children will be arranged on the screen. In React Native, `View` uses Flexbox for its children’s layout. You can learn more in [our guide to layout with Flexbox](flexbox).
+
+
+
+
+You can render this component multiple times and in multiple places without repeating your code by using ``:
+
+```SnackPlayer name=Multiple%20Components
+import React from 'react';
+import { Text, View } from 'react-native';
+
+const Cat = () => {
+ return (
+
+ I am also a cat!
+
+ );
+}
+
+const Cafe = () => {
+ return (
+
+ Welcome!
+
+
+
+
+ );
+}
+
+export default Cafe;
+```
+
+Any component that renders other components is a **parent component.** Here, `Cafe` is the parent component and each `Cat` is a **child component.**
+
+You can put as many cats in your cafe as you like. Each `` renders a unique element—which you can customize with props.
+
+## Props
+
+**Props** is short for “properties”. Props let you customize React components. For example, here you pass each `` a different `name` for `Cat` to render:
+
+```SnackPlayer name=Multiple%20Props
+import React from 'react';
+import { Text, View } from 'react-native';
+
+const Cat = (props) => {
+ return (
+
+ Hello, I am {props.name}!
+
+ );
+}
+
+const Cafe = () => {
+ return (
+
+
+
+
+
+ );
+}
+
+export default Cafe;
+```
+
+Most of React Native’s Core Components can be customized with props, too. For example, when using [`Image`](image), you pass it a prop named [`source`](image#source) to define what image it shows:
+
+```SnackPlayer name=Props
+import React from 'react';
+import { Text, View, Image } from 'react-native';
+
+const CatApp = () => {
+ return (
+
+
+ Hello, I am your cat!
+
+ );
+}
+
+export default CatApp;
+```
+
+`Image` has [many different props](image#props), including [`style`](image#style), which accepts a JS object of design and layout related property-value pairs.
+
+> Notice the double curly braces `{{ }}` surrounding `style`‘s width and height. In JSX, JavaScript values are referenced with `{}`. This is handy if you are passing something other than a string as props, like an array or number: ``. However, JS objects are **_also_** denoted with curly braces: `{width: 200, height: 200}`. Therefore, to pass a JS object in JSX, you must wrap the object in **another pair** of curly braces: `{{width: 200, height: 200}}`
+
+You can build many things with props and the Core Components [`Text`](text), [`Image`](image), and [`View`](view)! But to build something interactive, you’ll need state.
+
+## State
+
+While you can think of props as arguments you use to configure how components render, **state** is like a component’s personal data storage. State is useful for handling data that changes over time or that comes from user interaction. State gives your components memory!
+
+> As a general rule, use props to configure a component when it renders. Use state to keep track of any component data that you expect to change over time.
+
+The following example takes place in a cat cafe where two hungry cats are waiting to be fed. Their hunger, which we expect to change over time (unlike their names), is stored as state. To feed the cats, press their buttons—which will update their state.
+
+
+
+
+You can add state to a component by calling [React’s `useState` Hook](https://reactjs.org/docs/hooks-state.html). A Hook is a kind of function that lets you “hook into” React features. For example, `useState` is a Hook that lets you add state to function components. You can learn more about [other kinds of Hooks in the React documentation.](https://reactjs.org/docs/hooks-intro.html)
+
+```SnackPlayer name=State
+import React, { useState } from "react";
+import { Button, Text, View } from "react-native";
+
+const Cat = (props) => {
+ const [isHungry, setIsHungry] = useState(true);
+
+ return (
+
+
+ I am {props.name}, and I am {isHungry ? "hungry" : "full"}!
+
+ {
+ setIsHungry(false);
+ }}
+ disabled={!isHungry}
+ title={isHungry ? "Pour me some milk, please!" : "Thank you!"}
+ />
+
+ );
+}
+
+const Cafe = () => {
+ return (
+ <>
+
+
+ >
+ );
+}
+
+export default Cafe;
+```
+
+First, you will want to import `useState` from React like so:
+
+```jsx
+import React, { useState } from 'react';
+```
+
+Then you declare the component’s state by calling `useState` inside its function. In this example, `useState` creates an `isHungry` state variable:
+
+```jsx
+const Cat = (props) => {
+ const [isHungry, setIsHungry] = useState(true);
+ // ...
+};
+```
+
+> You can use `useState` to track any kind of data: strings, numbers, Booleans, arrays, objects. For example, you can track the number of times a cat has been petted with `const [timesPetted, setTimesPetted] = useState(0)`!
+
+Calling `useState` does two things:
+
+- it creates a “state variable” with an initial value—in this case the state variable is `isHungry` and its initial value is `true`
+- it creates a function to set that state variable’s value—`setIsHungry`
+
+It doesn’t matter what names you use. But it can be handy to think of the pattern as `[, ] = useState()`.
+
+Next you add the [`Button`](button) Core Component and give it an `onPress` prop:
+
+```jsx
+ {
+ setIsHungry(false);
+ }}
+ //..
+/>
+```
+
+Now, when someone presses the button, `onPress` will fire, calling the `setIsHungry(false)`. This sets the state variable `isHungry` to `false`. When `isHungry` is false, the `Button`’s `disabled` prop is set to `true` and its `title` also changes:
+
+```jsx
+
+```
+
+> You might’ve noticed that although `isHungry` is a [const](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/const), it is seemingly reassignable! What is happening is when a state-setting function like `setIsHungry` is called, its component will re-render. In this case the `Cat` function will run again—and this time, `useState` will give us the next value of `isHungry`.
+
+Finally, put your cats inside a `Cafe` component:
+
+```jsx
+const Cafe = () => {
+ return (
+ <>
+
+
+ >
+ );
+};
+```
+
+
+
+
+The older class components approach is a little different when it comes to state.
+
+```SnackPlayer name=State%20and%20Class%20Components
+import React, { Component } from "react";
+import { Button, Text, View } from "react-native";
+
+class Cat extends Component {
+ state = { isHungry: true };
+
+ render() {
+ return (
+
+
+ I am {this.props.name}, and I am
+ {this.state.isHungry ? " hungry" : " full"}!
+
+ {
+ this.setState({ isHungry: false });
+ }}
+ disabled={!this.state.isHungry}
+ title={
+ this.state.isHungry ? "Pour me some milk, please!" : "Thank you!"
+ }
+ />
+
+ );
+ }
+}
+
+class Cafe extends Component {
+ render() {
+ return (
+ <>
+
+
+ >
+ );
+ }
+}
+
+export default Cafe;
+```
+
+As always with class components, you must import the `Component` class from React:
+
+```jsx
+import React, { Component } from 'react';
+```
+
+In class components, state is stored in a state object:
+
+```jsx
+export class Cat extends Component {
+ state = { isHungry: true };
+ //..
+}
+```
+
+As with accessing props with `this.props`, you access this object inside your component with `this.state`:
+
+```jsx
+
+ I am {this.props.name}, and I am
+ {this.state.isHungry ? ' hungry' : ' full'}!
+
+```
+
+And you set individual values inside the state object by passing an object with the key value pair for state and its new value to `this.setState()`:
+
+```jsx
+ {
+ this.setState({ isHungry: false });
+ }}
+ // ..
+/>
+```
+
+> Do not change your component's state directly by assigning it a new value with `this.state.isHungry = false`. Calling `this.setState()` allows React to track changes made to state that trigger rerendering. Setting state directly can break your app's reactivity!
+
+When `this.state.isHungry` is false, the `Button`’s `disabled` prop is set to `true` and its `title` also changes:
+
+```jsx
+
+```
+
+Finally, put your cats inside a `Cafe` component:
+
+```jsx
+class Cafe extends Component {
+ render() {
+ return (
+ <>
+
+
+ >
+ );
+ }
+}
+
+export default Cafe;
+```
+
+
+
+
+> See the `<>` and `>` above? These bits of JSX are [fragments](https://reactjs.org/docs/fragments.html). Adjacent JSX elements must be wrapped in an enclosing tag. Fragments let you do that without nesting an extra, unnecessary wrapping element like `View`.
+
+---
+
+Now that you’ve covered both React and React Native’s Core Components, let’s dive deeper on some of these core components by looking at [handling ``](handling-text-input).
diff --git a/website/versioned_docs/version-0.70/introduction.md b/website/versioned_docs/version-0.70/introduction.md
new file mode 100644
index 00000000000..b57e6da77ae
--- /dev/null
+++ b/website/versioned_docs/version-0.70/introduction.md
@@ -0,0 +1,139 @@
+---
+id: getting-started
+title: Introduction
+description: This helpful guide lays out the prerequisites for learning React Native, using these docs, and setting up your environment.
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+
+
+ Welcome to the very start of your React Native journey! If you're looking for environment setup instructions, they've moved to their own section. Continue reading for an introduction to the documentation, Fabric Components, React, and more!
+
+
+
+
+Many different kinds of people use React Native: from advanced iOS developers to React beginners, to people getting started programming for the first time in their career. These docs were written for all learners, no matter their experience level or background.
+
+## How to use these docs
+
+You can start here and read through these docs linearly like a book; or you can read the specific sections you need. Already familiar with React? You can skip [that section](intro-react)—or read it for a light refresher.
+
+## Prerequisites
+
+To work with React Native, you will need to have an understanding of JavaScript fundamentals. If you’re new to JavaScript or need a refresher, you can [dive in](https://developer.mozilla.org/en-US/docs/Web/JavaScript) or [brush up](https://developer.mozilla.org/en-US/docs/Web/JavaScript/A_re-introduction_to_JavaScript) at Mozilla Developer Network.
+
+> While we do our best to assume no prior knowledge of React, Android, or iOS development, these are valuable topics of study for the aspiring React Native developer. Where sensible, we have linked to resources and articles that go more in depth.
+
+## Interactive examples
+
+This introduction lets you get started immediately in your browser with interactive examples like this one:
+
+```SnackPlayer name=Hello%20World
+import React from 'react';
+import { Text, View } from 'react-native';
+
+const YourApp = () => {
+ return (
+
+
+ Try editing me! 🎉
+
+
+ );
+}
+
+export default YourApp;
+```
+
+The above is a Snack Player. It’s a handy tool created by Expo to embed and run React Native projects and share how they render in platforms like Android and iOS. The code is live and editable, so you can play directly with it in your browser. Go ahead and try changing the "Try editing me!" text above to "Hello, world!"
+
+> Optionally, if you want to setup a local development environment, [you can follow our guide to setting up your environment on your local machine](environment-setup) and paste the code examples into your `App.js` file there. (If you are a web developer, you may already have a local environment set up for mobile browser testing!)
+
+## Function Components and Class Components
+
+With React, you can make components using either classes or functions. Originally, class components were the only components that could have state. But since the introduction of React's Hooks API, you can add state and more to function components.
+
+[Hooks were introduced in React Native 0.59.](/blog/2019/03/12/releasing-react-native-059), and because Hooks are the future-facing way to write your React components, we wrote this introduction using function component examples. Where useful, we also cover class components under a toggle like so:
+
+
+
+
+```SnackPlayer name=Hello%20World%20Function%20Component
+import React from 'react';
+import { Text, View } from 'react-native';
+
+const HelloWorldApp = () => {
+ return (
+
+ Hello, world!
+
+ );
+}
+
+export default HelloWorldApp;
+```
+
+
+
+
+```SnackPlayer name=Hello%20World%20Class%20Component
+import React, { Component } from 'react';
+import { Text, View } from 'react-native';
+
+class HelloWorldApp extends Component {
+ render() {
+ return (
+
+ Hello, world!
+
+ );
+ }
+}
+
+export default HelloWorldApp;
+```
+
+
+
+
+You can find more examples of class components in [previous versions of this documentation](/versions).
+
+## Developer Notes
+
+People from many different development backgrounds are learning React Native. You may have experience with a range of technologies, from web to Android to iOS and more. We try to write for developers from all backgrounds. Sometimes we provide explanations specific to one platform or another like so:
+
+
+
+
+
+> Android developers may be familiar with this concept.
+
+
+
+
+> iOS developers may be familiar with this concept.
+
+
+
+
+> Web developers may be familiar with this concept.
+
+
+
+
+## Formatting
+
+Menu paths are written in bold and use carets to navigate submenus. Example: **Android Studio > Preferences**
+
+---
+
+Now that you know how this guide works, it's time to get to know the foundation of React Native: [Fabric Components](the-new-architecture/pillars-fabric-components).
diff --git a/website/versioned_docs/version-0.70/javascript-environment.md b/website/versioned_docs/version-0.70/javascript-environment.md
new file mode 100644
index 00000000000..293903c6587
--- /dev/null
+++ b/website/versioned_docs/version-0.70/javascript-environment.md
@@ -0,0 +1,108 @@
+---
+id: javascript-environment
+title: JavaScript Environment
+---
+
+import TableRow from '@site/core/TableRowWithCodeBlock';
+
+## JavaScript Runtime
+
+When using React Native, you're going to be running your JavaScript code in two environments:
+
+- In most cases, React Native will use [JavaScriptCore](http://trac.webkit.org/wiki/JavaScriptCore), the JavaScript engine that powers Safari. Note that on iOS, JavaScriptCore does not use JIT due to the absence of writable executable memory in iOS apps.
+- When using Chrome debugging, all JavaScript code runs within Chrome itself, communicating with native code via WebSockets. Chrome uses [V8](https://v8.dev/) as its JavaScript engine.
+
+While both environments are very similar, you may end up hitting some inconsistencies. We're likely going to experiment with other JavaScript engines in the future, so it's best to avoid relying on specifics of any runtime.
+
+## JavaScript Syntax Transformers
+
+Syntax transformers make writing code more enjoyable by allowing you to use new JavaScript syntax without having to wait for support on all interpreters.
+
+React Native ships with the [Babel JavaScript compiler](https://babeljs.io). Check [Babel documentation](https://babeljs.io/docs/plugins/#transform-plugins) on its supported transformations for more details.
+
+A full list of React Native's enabled transformations can be found in [metro-react-native-babel-preset](https://github.com/facebook/metro/tree/master/packages/metro-react-native-babel-preset).
+
+
| string | The string that identifies the event you're listening for. See the list below. |
+| callback
Required
| function | The function to be called when the event fires |
+
+**`eventName`**
+
+This can be any of the following:
+
+- `keyboardWillShow`
+- `keyboardDidShow`
+- `keyboardWillHide`
+- `keyboardDidHide`
+- `keyboardWillChangeFrame`
+- `keyboardDidChangeFrame`
+
+> Note that only `keyboardDidShow` and `keyboardDidHide` events are available on Android. The events will not be fired when using Android 10 and under if your activity has `android:windowSoftInputMode` set to `adjustNothing`.
+
+---
+
+### `removeListener()`
+
+```jsx
+static removeListener(eventName, callback)
+```
+
+> **Deprecated.** Use the `remove()` method on the event subscription returned by [`addListener()`](#addlistener).
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| --------- | -------- | -------- | ------------------------------------------------------------------------------ |
+| eventName | string | Yes | The `nativeEvent` is the string that identifies the event you're listening for |
+| callback | function | Yes | The function to be called when the event fires |
+
+---
+
+### `removeAllListeners()`
+
+```jsx
+static removeAllListeners(eventName)
+```
+
+Removes all listeners for a specific event type.
+
+**Parameters:**
+
+| Name | Type | Required | Description |
+| --------- | ------ | -------- | -------------------------------------------------------------------- |
+| eventType | string | Yes | The native event string listeners are watching which will be removed |
+
+---
+
+### `dismiss()`
+
+```jsx
+static dismiss()
+```
+
+Dismisses the active keyboard and removes focus.
+
+---
+
+### `scheduleLayoutAnimation`
+
+```jsx
+static scheduleLayoutAnimation(event)
+```
+
+Useful for syncing TextInput (or other keyboard accessory view) size of position changes with keyboard movements.
diff --git a/website/versioned_docs/version-0.70/keyboardavoidingview.md b/website/versioned_docs/version-0.70/keyboardavoidingview.md
new file mode 100644
index 00000000000..63af5f4183f
--- /dev/null
+++ b/website/versioned_docs/version-0.70/keyboardavoidingview.md
@@ -0,0 +1,111 @@
+---
+id: keyboardavoidingview
+title: KeyboardAvoidingView
+---
+
+This component will automatically adjust its height, position, or bottom padding based on the keyboard height to remain visible while the virtual keyboard is displayed.
+
+## Example
+
+```SnackPlayer name=KeyboardAvoidingView&supportedPlatforms=android,ios
+import React from 'react';
+import { View, KeyboardAvoidingView, TextInput, StyleSheet, Text, Platform, TouchableWithoutFeedback, Button, Keyboard } from 'react-native';
+
+const KeyboardAvoidingComponent = () => {
+ return (
+
+
+
+ Header
+
+
+ null} />
+
+
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1
+ },
+ inner: {
+ padding: 24,
+ flex: 1,
+ justifyContent: "space-around"
+ },
+ header: {
+ fontSize: 36,
+ marginBottom: 48
+ },
+ textInput: {
+ height: 40,
+ borderColor: "#000000",
+ borderBottomWidth: 1,
+ marginBottom: 36
+ },
+ btnContainer: {
+ backgroundColor: "white",
+ marginTop: 12
+ }
+});
+
+export default KeyboardAvoidingComponent;
+```
+
+---
+
+# Reference
+
+## Props
+
+### [View Props](view.md#props)
+
+Inherits [View Props](view.md#props).
+
+---
+
+### `behavior`
+
+Specify how to react to the presence of the keyboard.
+
+> Android and iOS both interact with this prop differently. On both iOS and Android, setting `behavior` is recommended.
+
+| Type |
+| ------------------------------------------- |
+| enum(`'height'`, `'position'`, `'padding'`) |
+
+---
+
+### `contentContainerStyle`
+
+The style of the content container (View) when behavior is `'position'`.
+
+| Type |
+| --------------------------------- |
+| [View Style](view-style-props.md) |
+
+---
+
+### `enabled`
+
+Enabled or disabled KeyboardAvoidingView.
+
+| Type | Default |
+| ------- | ------- |
+| boolean | `true` |
+
+---
+
+### `keyboardVerticalOffset`
+
+This is the distance between the top of the user screen and the react native view, may be non-zero in some use cases.
+
+| Type | Default |
+| ------ | ------- |
+| number | `0` |
diff --git a/website/versioned_docs/version-0.70/layout-props.md b/website/versioned_docs/version-0.70/layout-props.md
new file mode 100644
index 00000000000..3f92f1af490
--- /dev/null
+++ b/website/versioned_docs/version-0.70/layout-props.md
@@ -0,0 +1,772 @@
+---
+id: layout-props
+title: Layout Props
+---
+
+> More detailed examples about those properties can be found on the [Layout with Flexbox](flexbox) page.
+
+### Example
+
+The following example shows how different properties can affect or shape a React Native layout. You can try for example to add or remove squares from the UI while changing the values of the property `flexWrap`.
+
+```SnackPlayer name=LayoutProps%20Example
+import React, { useState } from 'react';
+import { Button, ScrollView, StatusBar, StyleSheet, Text, View } from 'react-native';
+
+const App = () => {
+ const flexDirections = ['row', 'row-reverse', 'column', 'column-reverse'];
+ const justifyContents = [
+ 'flex-start',
+ 'flex-end',
+ 'center',
+ 'space-between',
+ 'space-around',
+ 'space-evenly',
+ ];
+ const alignItemsArr = [
+ 'flex-start',
+ 'flex-end',
+ 'center',
+ 'stretch',
+ 'baseline',
+ ];
+ const wraps = ['nowrap', 'wrap', 'wrap-reverse'];
+ const directions = ['inherit', 'ltr', 'rtl'];
+ const [flexDirection, setFlexDirection] = useState(0);
+ const [justifyContent, setJustifyContent] = useState(0);
+ const [alignItems, setAlignItems] = useState(0);
+ const [direction, setDirection] = useState(0);
+ const [wrap, setWrap] = useState(0);
+
+ const hookedStyles = {
+ flexDirection: flexDirections[flexDirection],
+ justifyContent: justifyContents[justifyContent],
+ alignItems: alignItemsArr[alignItems],
+ direction: directions[direction],
+ flexWrap: wraps[wrap],
+ };
+
+ const changeSetting = (value, options, setterFunction) => {
+ if (value == options.length - 1) {
+ setterFunction(0);
+ return;
+ }
+ setterFunction(value + 1);
+ };
+ const [squares, setSquares] = useState([, , ]);
+ return (
+ <>
+
+
+ {squares.map(elem => elem)}
+
+
+
+
+
+ changeSetting(flexDirection, flexDirections, setFlexDirection)
+ }
+ />
+ {flexDirections[flexDirection]}
+
+
+
+ changeSetting(
+ justifyContent,
+ justifyContents,
+ setJustifyContent
+ )
+ }
+ />
+ {justifyContents[justifyContent]}
+
+
+
+ changeSetting(alignItems, alignItemsArr, setAlignItems)
+ }
+ />
+ {alignItemsArr[alignItems]}
+
+
+ changeSetting(direction, directions, setDirection)}
+ />
+ {directions[direction]}
+
+
+ changeSetting(wrap, wraps, setWrap)}
+ />
+ {wraps[wrap]}
+
+
+ setSquares([...squares, ])}
+ />
+
+
+
+ setSquares(squares.filter((v, i) => i != squares.length - 1))
+ }
+ />
+
+
+
+ >
+ );
+};
+
+const styles = StyleSheet.create({
+ container: {
+ height: '50%',
+ },
+ playingSpace: {
+ backgroundColor: 'white',
+ borderColor: 'blue',
+ borderWidth: 3,
+ },
+ controlSpace: {
+ flexDirection: 'row',
+ flexWrap: 'wrap',
+ backgroundColor: '#F5F5F5',
+ },
+ buttonView: {
+ width: '50%',
+ padding: 10,
+ },
+ text: { textAlign: 'center' },
+});
+
+const Square = () => (
+
+);
+
+const randomHexColor = () => {
+ return '#000000'.replace(/0/g, () => {
+ return (~~(Math.random() * 16)).toString(16);
+ });
+};
+
+export default App;
+```
+
+---
+
+# Reference
+
+## Props
+
+### `alignContent`
+
+`alignContent` controls how rows align in the cross direction, overriding the `alignContent` of the parent. See https://developer.mozilla.org/en-US/docs/Web/CSS/align-content for more details.
+
+| Type | Required |
+| ------------------------------------------------------------------------------------ | -------- |
+| enum('flex-start', 'flex-end', 'center', 'stretch', 'space-between', 'space-around') | No |
+
+---
+
+### `alignItems`
+
+`alignItems` aligns children in the cross direction. For example, if children are flowing vertically, `alignItems` controls how they align horizontally. It works like `align-items` in CSS (default: stretch). See https://developer.mozilla.org/en-US/docs/Web/CSS/align-items for more details.
+
+| Type | Required |
+| --------------------------------------------------------------- | -------- |
+| enum('flex-start', 'flex-end', 'center', 'stretch', 'baseline') | No |
+
+---
+
+### `alignSelf`
+
+`alignSelf` controls how a child aligns in the cross direction, overriding the `alignItems` of the parent. It works like `align-self` in CSS (default: auto). See https://developer.mozilla.org/en-US/docs/Web/CSS/align-self for more details.
+
+| Type | Required |
+| ----------------------------------------------------------------------- | -------- |
+| enum('auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline') | No |
+
+---
+
+### `aspectRatio`
+
+Aspect ratio controls the size of the undefined dimension of a node. See https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio for more details.
+
+- On a node with a set width/height, aspect ratio controls the size of the unset dimension
+- On a node with a set flex basis, aspect ratio controls the size of the node in the cross axis if unset
+- On a node with a measure function, aspect ratio works as though the measure function measures the flex basis
+- On a node with flex grow/shrink, aspect ratio controls the size of the node in the cross axis if unset
+- Aspect ratio takes min/max dimensions into account
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `borderBottomWidth`
+
+`borderBottomWidth` works like `border-bottom-width` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width for more details.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `borderEndWidth`
+
+When direction is `ltr`, `borderEndWidth` is equivalent to `borderRightWidth`. When direction is `rtl`, `borderEndWidth` is equivalent to `borderLeftWidth`.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `borderLeftWidth`
+
+`borderLeftWidth` works like `border-left-width` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-width for more details.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `borderRightWidth`
+
+`borderRightWidth` works like `border-right-width` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-width for more details.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `borderStartWidth`
+
+When direction is `ltr`, `borderStartWidth` is equivalent to `borderLeftWidth`. When direction is `rtl`, `borderStartWidth` is equivalent to `borderRightWidth`.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `borderTopWidth`
+
+`borderTopWidth` works like `border-top-width` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width for more details.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `borderWidth`
+
+`borderWidth` works like `border-width` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/border-width for more details.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `bottom`
+
+`bottom` is the number of logical pixels to offset the bottom edge of this component.
+
+It works similarly to `bottom` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/bottom for more details of how `bottom` affects layout.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `direction`
+
+`direction` specifies the directional flow of the user interface. The default is `inherit`, except for root node which will have value based on the current locale. See https://yogalayout.com/docs/layout-direction for more details.
+
+| Type | Required | Platform |
+| ----------------------------- | -------- | -------- |
+| enum('inherit', 'ltr', 'rtl') | No | iOS |
+
+---
+
+### `display`
+
+`display` sets the display type of this component.
+
+It works similarly to `display` in CSS but only supports 'flex' and 'none'. 'flex' is the default.
+
+| Type | Required |
+| -------------------- | -------- |
+| enum('none', 'flex') | No |
+
+---
+
+### `end`
+
+When the direction is `ltr`, `end` is equivalent to `right`. When the direction is `rtl`, `end` is equivalent to `left`.
+
+This style takes precedence over the `left` and `right` styles.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `flex`
+
+In React Native `flex` does not work the same way that it does in CSS. `flex` is a number rather than a string, and it works according to the [Yoga](https://github.com/facebook/yoga) layout engine.
+
+When `flex` is a positive number, it makes the component flexible, and it will be sized proportional to its flex value. So a component with `flex` set to 2 will take twice the space as a component with `flex` set to 1. `flex: ` equates to `flexGrow: , flexShrink: 1, flexBasis: 0`.
+
+When `flex` is 0, the component is sized according to `width` and `height`, and it is inflexible.
+
+When `flex` is -1, the component is normally sized according to `width` and `height`. However, if there's not enough space, the component will shrink to its `minWidth` and `minHeight`.
+
+`flexGrow`, `flexShrink`, and `flexBasis` work the same as in CSS.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `flexBasis`
+
+`flexBasis` is an axis-independent way of providing the default size of an item along the main axis. Setting the `flexBasis` of a child is similar to setting the `width` of that child if its parent is a container with `flexDirection: row` or setting the `height` of a child if its parent is a container with `flexDirection: column`. The `flexBasis` of an item is the default size of that item, the size of the item before any `flexGrow` and `flexShrink` calculations are performed.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `flexDirection`
+
+`flexDirection` controls which directions children of a container go. `row` goes left to right, `column` goes top to bottom, and you may be able to guess what the other two do. It works like `flex-direction` in CSS, except the default is `column`. See https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction for more details.
+
+| Type | Required |
+| ------------------------------------------------------ | -------- |
+| enum('row', 'row-reverse', 'column', 'column-reverse') | No |
+
+---
+
+### `flexGrow`
+
+`flexGrow` describes how any space within a container should be distributed among its children along the main axis. After laying out its children, a container will distribute any remaining space according to the flex grow values specified by its children.
+
+`flexGrow` accepts any floating point value >= 0, with 0 being the default value. A container will distribute any remaining space among its children weighted by the children’s `flexGrow` values.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `flexShrink`
+
+[`flexShrink`](layout-props#flexshrink) describes how to shrink children along the main axis in the case in which the total size of the children overflows the size of the container on the main axis. `flexShrink` is very similar to `flexGrow` and can be thought of in the same way if any overflowing size is considered to be negative remaining space. These two properties also work well together by allowing children to grow and shrink as needed.
+
+`flexShrink` accepts any floating point value >= 0, with 0 being the default value. A container will shrink its children weighted by the children’s `flexShrink` values.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
+
+### `flexWrap`
+
+`flexWrap` controls whether children can wrap around after they hit the end of a flex container. It works like `flex-wrap` in CSS (default: nowrap). See https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap for more details. Note it does not work anymore with `alignItems: stretch` (the default), so you may want to use `alignItems: flex-start` for example (breaking change details: https://github.com/facebook/react-native/releases/tag/v0.28.0).
+
+| Type | Required |
+| -------------------------------------- | -------- |
+| enum('wrap', 'nowrap', 'wrap-reverse') | No |
+
+---
+
+### `height`
+
+`height` sets the height of this component.
+
+It works similarly to `height` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported. See https://developer.mozilla.org/en-US/docs/Web/CSS/height for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `justifyContent`
+
+`justifyContent` aligns children in the main direction. For example, if children are flowing vertically, `justifyContent` controls how they align vertically. It works like `justify-content` in CSS (default: flex-start). See https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content for more details.
+
+| Type | Required |
+| ----------------------------------------------------------------------------------------- | -------- |
+| enum('flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly') | No |
+
+---
+
+### `left`
+
+`left` is the number of logical pixels to offset the left edge of this component.
+
+It works similarly to `left` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/left for more details of how `left` affects layout.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `margin`
+
+Setting `margin` has the same effect as setting each of `marginTop`, `marginLeft`, `marginBottom`, and `marginRight`. See https://developer.mozilla.org/en-US/docs/Web/CSS/margin for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginBottom`
+
+`marginBottom` works like `margin-bottom` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginEnd`
+
+When direction is `ltr`, `marginEnd` is equivalent to `marginRight`. When direction is `rtl`, `marginEnd` is equivalent to `marginLeft`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginHorizontal`
+
+Setting `marginHorizontal` has the same effect as setting both `marginLeft` and `marginRight`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginLeft`
+
+`marginLeft` works like `margin-left` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginRight`
+
+`marginRight` works like `margin-right` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginStart`
+
+When direction is `ltr`, `marginStart` is equivalent to `marginLeft`. When direction is `rtl`, `marginStart` is equivalent to `marginRight`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginTop`
+
+`marginTop` works like `margin-top` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `marginVertical`
+
+Setting `marginVertical` has the same effect as setting both `marginTop` and `marginBottom`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `maxHeight`
+
+`maxHeight` is the maximum height for this component, in logical pixels.
+
+It works similarly to `max-height` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/max-height for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `maxWidth`
+
+`maxWidth` is the maximum width for this component, in logical pixels.
+
+It works similarly to `max-width` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/max-width for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `minHeight`
+
+`minHeight` is the minimum height for this component, in logical pixels.
+
+It works similarly to `min-height` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/min-height for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `minWidth`
+
+`minWidth` is the minimum width for this component, in logical pixels.
+
+It works similarly to `min-width` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/min-width for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `overflow`
+
+`overflow` controls how children are measured and displayed. `overflow: hidden` causes views to be clipped while `overflow: scroll` causes views to be measured independently of their parents' main axis. It works like `overflow` in CSS (default: visible). See https://developer.mozilla.org/en/docs/Web/CSS/overflow for more details.
+
+| Type | Required |
+| ----------------------------------- | -------- |
+| enum('visible', 'hidden', 'scroll') | No |
+
+---
+
+### `padding`
+
+Setting `padding` has the same effect as setting each of `paddingTop`, `paddingBottom`, `paddingLeft`, and `paddingRight`. See https://developer.mozilla.org/en-US/docs/Web/CSS/padding for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `paddingBottom`
+
+`paddingBottom` works like `padding-bottom` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `paddingEnd`
+
+When direction is `ltr`, `paddingEnd` is equivalent to `paddingRight`. When direction is `rtl`, `paddingEnd` is equivalent to `paddingLeft`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `paddingHorizontal`
+
+Setting `paddingHorizontal` is like setting both of `paddingLeft` and `paddingRight`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `paddingLeft`
+
+`paddingLeft` works like `padding-left` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `paddingRight`
+
+`paddingRight` works like `padding-right` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `paddingStart`
+
+When direction is `ltr`, `paddingStart` is equivalent to `paddingLeft`. When direction is `rtl`, `paddingStart` is equivalent to `paddingRight`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `paddingTop`
+
+`paddingTop` works like `padding-top` in CSS. See https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top for more details.
+
+| Type | Required |
+| --------------- | -------- |
+| number, ,string | No |
+
+---
+
+### `paddingVertical`
+
+Setting `paddingVertical` is like setting both of `paddingTop` and `paddingBottom`.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `position`
+
+`position` in React Native is similar to regular CSS, but everything is set to `relative` by default, so `absolute` positioning is always relative to the parent.
+
+If you want to position a child using specific numbers of logical pixels relative to its parent, set the child to have `absolute` position.
+
+If you want to position a child relative to something that is not its parent, don't use styles for that. Use the component tree.
+
+See https://github.com/facebook/yoga for more details on how `position` differs between React Native and CSS.
+
+| Type | Required |
+| ---------------------------- | -------- |
+| enum('absolute', 'relative') | No |
+
+---
+
+### `right`
+
+`right` is the number of logical pixels to offset the right edge of this component.
+
+It works similarly to `right` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/right for more details of how `right` affects layout.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `start`
+
+When the direction is `ltr`, `start` is equivalent to `left`. When the direction is `rtl`, `start` is equivalent to `right`.
+
+This style takes precedence over the `left`, `right`, and `end` styles.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `top`
+
+`top` is the number of logical pixels to offset the top edge of this component.
+
+It works similarly to `top` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported.
+
+See https://developer.mozilla.org/en-US/docs/Web/CSS/top for more details of how `top` affects layout.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `width`
+
+`width` sets the width of this component.
+
+It works similarly to `width` in CSS, but in React Native you must use points or percentages. Ems and other units are not supported. See https://developer.mozilla.org/en-US/docs/Web/CSS/width for more details.
+
+| Type | Required |
+| -------------- | -------- |
+| number, string | No |
+
+---
+
+### `zIndex`
+
+`zIndex` controls which components display on top of others. Normally, you don't use `zIndex`. Components render according to their order in the document tree, so later components draw over earlier ones. `zIndex` may be useful if you have animations or custom modal interfaces where you don't want this behavior.
+
+It works like the CSS `z-index` property - components with a larger `zIndex` will render on top. Think of the z-direction like it's pointing from the phone into your eyeball. See https://developer.mozilla.org/en-US/docs/Web/CSS/z-index for more details.
+
+On iOS, `zIndex` may require `View`s to be siblings of each other for it to work as expected.
+
+| Type | Required |
+| ------ | -------- |
+| number | No |
+
+---
diff --git a/website/versioned_docs/version-0.70/layoutanimation.md b/website/versioned_docs/version-0.70/layoutanimation.md
new file mode 100644
index 00000000000..10da37ba67d
--- /dev/null
+++ b/website/versioned_docs/version-0.70/layoutanimation.md
@@ -0,0 +1,549 @@
+---
+id: layoutanimation
+title: LayoutAnimation
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+Automatically animates views to their new positions when the next layout happens.
+
+A common way to use this API is to call it before updating the state hook in functional components and calling `setState` in class components.
+
+Note that in order to get this to work on **Android** you need to set the following flags via `UIManager`:
+
+```js
+if (Platform.OS === 'android') {
+ if (UIManager.setLayoutAnimationEnabledExperimental) {
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+ }
+}
+```
+
+## Example
+
+```SnackPlayer name=LayoutAnimation&supportedPlatforms=android,ios
+import React, { useState } from "react";
+import { LayoutAnimation, Platform, StyleSheet, Text, TouchableOpacity, UIManager, View } from "react-native";
+
+if (
+ Platform.OS === "android" &&
+ UIManager.setLayoutAnimationEnabledExperimental
+) {
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+}
+const App = () => {
+ const [expanded, setExpanded] = useState(false);
+
+ return (
+
+ {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
+ setExpanded(!expanded);
+ }}
+ >
+ Press me to {expanded ? "collapse" : "expand"}!
+
+ {expanded && (
+
+ I disappear sometimes!
+
+ )}
+
+ );
+};
+
+const style = StyleSheet.create({
+ tile: {
+ backgroundColor: "lightgrey",
+ borderWidth: 0.5,
+ borderColor: "#d6d7da"
+ },
+ container: {
+ flex: 1,
+ justifyContent: "center",
+ alignItems: "center",
+ overflow: "hidden"
+ }
+});
+
+export default App;
+```
+
+---
+
+# Reference
+
+## Methods
+
+### `configureNext()`
+
+```jsx
+static configureNext(config, onAnimationDidEnd?, onAnimationDidFail?)
+```
+
+Schedules an animation to happen on the next layout.
+
+#### Parameters:
+
+| Name | Type | Required | Description |
+| ------------------ | -------- | -------- | ----------------------------------- |
+| config | object | Yes | See config description below. |
+| onAnimationDidEnd | function | No | Called when the animation finished. |
+| onAnimationDidFail | function | No | Called when the animation failed. |
+
+The `config` parameter is an object with the keys below. [`create`](layoutanimation.md#create) returns a valid object for `config`, and the [`Presets`](layoutanimation.md#presets) objects can also all be passed as the `config`.
+
+- `duration` in milliseconds
+- `create`, optional config for animating in new views
+- `update`, optional config for animating views that have been updated
+- `delete`, optional config for animating views as they are removed
+
+The config that's passed to `create`, `update`, or `delete` has the following keys:
+
+- `type`, the [animation type](layoutanimation.md#types) to use
+- `property`, the [layout property](layoutanimation.md#properties) to animate (optional, but recommended for `create` and `delete`)
+- `springDamping` (number, optional and only for use with `type: Type.spring`)
+- `initialVelocity` (number, optional)
+- `delay` (number, optional)
+- `duration` (number, optional)
+
+---
+
+### `create()`
+
+```jsx
+static create(duration, type, creationProp)
+```
+
+Helper that creates an object (with `create`, `update`, and `delete` fields) to pass into [`configureNext`](layoutanimation.md#configurenext). The `type` parameter is an [animation type](layoutanimation.md#types), and the `creationProp` parameter is a [layout property](layoutanimation.md#properties).
+
+**Example:**
+
+
+
+
+```SnackPlayer name=LayoutAnimation&supportedPlatforms=android,ios
+import React, { useState } from "react";
+import {
+ View,
+ Platform,
+ UIManager,
+ LayoutAnimation,
+ StyleSheet,
+ Button
+} from "react-native";
+
+if (
+ Platform.OS === "android" &&
+ UIManager.setLayoutAnimationEnabledExperimental
+) {
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+}
+
+const App = () => {
+ const [boxPosition, setBoxPosition] = useState("left");
+
+ const toggleBox = () => {
+ LayoutAnimation.configureNext({
+ duration: 500,
+ create: { type: "linear", property: "opacity" },
+ update: { type: "spring", springDamping: 0.4 },
+ delete: { type: "linear", property: "opacity" }
+ });
+ setBoxPosition(boxPosition === "left" ? "right" : "left");
+ };
+
+ return (
+
+
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "flex-start",
+ justifyContent: "center"
+ },
+ box: {
+ height: 100,
+ width: 100,
+ borderRadius: 5,
+ margin: 8,
+ backgroundColor: "blue"
+ },
+ moveRight: {
+ alignSelf: "flex-end",
+ height: 200,
+ width: 200
+ },
+ buttonContainer: {
+ alignSelf: "center"
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=LayoutAnimation&supportedPlatforms=android,ios
+import React, { Component } from "react";
+import {
+ View,
+ Platform,
+ UIManager,
+ LayoutAnimation,
+ StyleSheet,
+ Button
+} from "react-native";
+
+if (
+ Platform.OS === "android" &&
+ UIManager.setLayoutAnimationEnabledExperimental
+) {
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+}
+
+class App extends Component {
+ state = {
+ boxPosition: "left"
+ };
+
+ toggleBox = () => {
+ LayoutAnimation.configureNext({
+ duration: 500,
+ create: { type: "linear", property: "opacity" },
+ update: { type: "spring", springDamping: 0.4 },
+ delete: { type: "linear", property: "opacity" }
+ });
+ this.setState({
+ boxPosition: this.state.boxPosition === "left" ? "right" : "left"
+ });
+ };
+
+ render() {
+ return (
+
+
+
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "flex-start",
+ justifyContent: "center"
+ },
+ box: {
+ height: 100,
+ width: 100,
+ borderRadius: 5,
+ margin: 8,
+ backgroundColor: "blue"
+ },
+ moveRight: {
+ alignSelf: "flex-end",
+ height: 200,
+ width: 200
+ },
+ buttonContainer: {
+ alignSelf: "center"
+ }
+});
+
+export default App;
+```
+
+
+
+
+## Properties
+
+### Types
+
+An enumeration of animation types to be used in the [`create`](layoutanimation.md#create) method, or in the `create`/`update`/`delete` configs for [`configureNext`](layoutanimation.md#configurenext). (example usage: `LayoutAnimation.Types.easeIn`)
+
+| Types |
+| ------------- |
+| spring |
+| linear |
+| easeInEaseOut |
+| easeIn |
+| easeOut |
+| keyboard |
+
+---
+
+### Properties
+
+An enumeration of layout properties to be animated to be used in the [`create`](layoutanimation.md#create) method, or in the `create`/`update`/`delete` configs for [`configureNext`](layoutanimation.md#configurenext). (example usage: `LayoutAnimation.Properties.opacity`)
+
+| Properties |
+| ---------- |
+| opacity |
+| scaleX |
+| scaleY |
+| scaleXY |
+
+---
+
+### Presets
+
+A set of predefined animation configs to pass into [`configureNext`](layoutanimation.md#configurenext).
+
+| Presets | Value |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| easeInEaseOut | `create(300, 'easeInEaseOut', 'opacity')` |
+| linear | `create(500, 'linear', 'opacity')` |
+| spring | `{ duration: 700, create: { type: 'linear', property: 'opacity' }, update: { type: 'spring', springDamping: 0.4 }, delete: { type: 'linear', property: 'opacity' } }` |
+
+---
+
+### `easeInEaseOut`
+
+Calls `configureNext()` with `Presets.easeInEaseOut`.
+
+---
+
+### `linear`
+
+Calls `configureNext()` with `Presets.linear`.
+
+---
+
+### `spring`
+
+Calls `configureNext()` with `Presets.spring`.
+
+**Example:**
+
+
+
+
+```SnackPlayer name=LayoutAnimation&supportedPlatforms=android,ios
+import React, { useState } from "react";
+import {
+ View,
+ Platform,
+ UIManager,
+ LayoutAnimation,
+ StyleSheet,
+ Button
+} from "react-native";
+
+if (
+ Platform.OS === "android" &&
+ UIManager.setLayoutAnimationEnabledExperimental
+) {
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+}
+
+const App = () => {
+ const [firstBoxPosition, setFirstBoxPosition] = useState("left");
+ const [secondBoxPosition, setSecondBoxPosition] = useState("left");
+ const [thirdBoxPosition, setThirdBoxPosition] = useState("left");
+
+ const toggleFirstBox = () => {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
+ setFirstBoxPosition(firstBoxPosition === "left" ? "right" : "left");
+ };
+
+ const toggleSecondBox = () => {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.linear);
+ setSecondBoxPosition(secondBoxPosition === "left" ? "right" : "left");
+ };
+
+ const toggleThirdBox = () => {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
+ setThirdBoxPosition(thirdBoxPosition === "left" ? "right" : "left");
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "flex-start",
+ justifyContent: "center"
+ },
+ box: {
+ height: 100,
+ width: 100,
+ borderRadius: 5,
+ margin: 8,
+ backgroundColor: "blue"
+ },
+ moveRight: {
+ alignSelf: "flex-end"
+ },
+ buttonContainer: {
+ alignSelf: "center"
+ }
+});
+
+export default App;
+```
+
+
+
+
+```SnackPlayer name=LayoutAnimation&supportedPlatforms=android,ios
+import React, { Component } from "react";
+import {
+ View,
+ Platform,
+ UIManager,
+ LayoutAnimation,
+ StyleSheet,
+ Button
+} from "react-native";
+
+if (
+ Platform.OS === "android" &&
+ UIManager.setLayoutAnimationEnabledExperimental
+) {
+ UIManager.setLayoutAnimationEnabledExperimental(true);
+}
+
+class App extends Component {
+ state = {
+ firstBoxPosition: "left",
+ secondBoxPosition: "left",
+ thirdBoxPosition: "left"
+ };
+
+ toggleFirstBox = () => {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
+ this.setState({
+ firstBoxPosition:
+ this.state.firstBoxPosition === "left" ? "right" : "left"
+ });
+ };
+
+ toggleSecondBox = () => {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.linear);
+ this.setState({
+ secondBoxPosition:
+ this.state.secondBoxPosition === "left" ? "right" : "left"
+ });
+ };
+
+ toggleThirdBox = () => {
+ LayoutAnimation.configureNext(LayoutAnimation.Presets.spring);
+ this.setState({
+ thirdBoxPosition:
+ this.state.thirdBoxPosition === "left" ? "right" : "left"
+ });
+ };
+
+ render() {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+ }
+}
+
+const styles = StyleSheet.create({
+ container: {
+ flex: 1,
+ alignItems: "flex-start",
+ justifyContent: "center"
+ },
+ box: {
+ height: 100,
+ width: 100,
+ borderRadius: 5,
+ margin: 8,
+ backgroundColor: "blue"
+ },
+ moveRight: {
+ alignSelf: "flex-end"
+ },
+ buttonContainer: {
+ alignSelf: "center"
+ }
+});
+
+export default App;
+```
+
+
+
diff --git a/website/versioned_docs/version-0.70/layoutevent.md b/website/versioned_docs/version-0.70/layoutevent.md
new file mode 100644
index 00000000000..b0fda8501db
--- /dev/null
+++ b/website/versioned_docs/version-0.70/layoutevent.md
@@ -0,0 +1,72 @@
+---
+id: layoutevent
+title: LayoutEvent Object Type
+---
+
+`LayoutEvent` object is returned in the callback as a result of component layout change, for example `onLayout` in [View](view) component.
+
+## Example
+
+```js
+{
+ layout: {
+ width: 520,
+ height: 70.5,
+ x: 0,
+ y: 42.5
+ },
+ target: 1127
+}
+```
+
+## Keys and values
+
+### `height`
+
+Height of the component after the layout changes.
+
+| Type | Optional |
+| ------ | -------- |
+| number | No |
+
+### `width`
+
+Width of the component after the layout changes.
+
+| Type | Optional |
+| ------ | -------- |
+| number | No |
+
+### `x`
+
+Component X coordinate inside the parent component.
+
+| Type | Optional |
+| ------ | -------- |
+| number | No |
+
+### `y`
+
+Component Y coordinate inside the parent component.
+
+| Type | Optional |
+| ------ | -------- |
+| number | No |
+
+### `target`
+
+The node id of the element receiving the PressEvent.
+
+| Type | Optional |
+| --------------------------- | -------- |
+| number, `null`, `undefined` | No |
+
+## Used by
+
+- [`Image`](image)
+- [`Pressable`](pressable)
+- [`ScrollView`](scrollview)
+- [`Text`](text)
+- [`TextInput`](textinput)
+- [`TouchableWithoutFeedback`](touchablewithoutfeedback)
+- [`View`](view)
diff --git a/website/versioned_docs/version-0.70/libraries.md b/website/versioned_docs/version-0.70/libraries.md
new file mode 100644
index 00000000000..e8c1a10bcf1
--- /dev/null
+++ b/website/versioned_docs/version-0.70/libraries.md
@@ -0,0 +1,94 @@
+---
+id: libraries
+title: Using Libraries
+author: Brent Vatne
+authorURL: 'https://twitter.com/notbrent'
+description: This guide introduces React Native developers to finding, installing, and using third-party libraries in their apps.
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; import M1Cocoapods from './\_markdown-m1-cocoapods.mdx';
+
+React Native provides a set of built-in [Core Components and APIs](./components-and-apis) ready to use in your app. You're not limited to the components and APIs bundled with React Native. React Native has a community of thousands of developers. If the Core Components and APIs don't have what you are looking for, you may be able to find and install a library from the community to add the functionality to your app.
+
+## Selecting a Package Manager
+
+React Native libraries are typically installed from the [npm registry](https://www.npmjs.com/) using a Node.js package manager such as [npm CLI](https://docs.npmjs.com/cli/npm) or [Yarn Classic](https://classic.yarnpkg.com/en/).
+
+If you have Node.js installed on your computer then you already have the npm CLI installed. Some developers prefer to use Yarn Classic for slightly faster install times and additional advanced features like Workspaces. Both tools work great with React Native. We will assume npm for the rest of this guide for simplicity of explanation.
+
+> 💡 The terms "library" and "package" are used interchangeably in the JavaScript community.
+
+## Installing a Library
+
+To install a library in your project, navigate to your project directory in your terminal and run the installation command. Let's try this with `react-native-webview`:
+
+
+
+
+```shell
+npm install react-native-webview
+```
+
+
+
+
+```shell
+yarn add react-native-webview
+```
+
+
+
+
+The library that we installed includes native code, and we need to link to our app before we use it.
+
+## Linking Native Code on iOS
+
+React Native uses CocoaPods to manage iOS project dependencies and most React Native libraries follow this same convention. If a library you are using does not, then please refer to their README for additional instruction. In most cases, the following instructions will apply.
+
+Run `pod install` in our `ios` directory in order to link it to our native iOS project. A shortcut for doing this without switching to the `ios` directory is to run `npx pod-install`.
+
+```bash
+npx pod-install
+```
+
+
+
+Once this is complete, re-build the app binary to start using your new library:
+
+```bash
+npx react-native run-ios
+```
+
+## Linking Native Code on Android
+
+React Native uses Gradle to manage Android project dependencies. After you install a library with native dependencies, you will need to re-build the app binary to use your new library:
+
+```bash
+npx react-native run-android
+```
+
+## Finding Libraries
+
+[React Native Directory](https://reactnative.directory) is a searchable database of libraries built specifically for React Native. This is the first place to look for a library for your React Native app.
+
+Many of the libraries you will find on the directory are from [React Native Community](https://github.com/react-native-community/) or [Expo](https://docs.expo.dev/versions/latest/).
+
+Libraries built by the React Native Community are driven by volunteers and individuals at companies that depend on React Native. They often support iOS, tvOS, Android, Windows, but this varies across projects. Many of the libraries in this organization were once React Native Core Components and APIs.
+
+Libraries built by Expo are all written in TypeScript and support iOS, Android, and `react-native-web` wherever possible.
+
+After React Native Directory, the [npm registry](https://www.npmjs.com/) is the next best place if you can't find a library specifically for React Native on the directory. The npm registry is the definitive source for JavaScript libraries, but the libraries that it lists may not all be compatible with React Native. React Native is one of many JavaScript programming environments, including Node.js, web browsers, Electron, and more, and npm includes libraries that work for all of these environments.
+
+## Determining Library Compatibility
+
+### Does it work with React Native?
+
+Usually libraries built _specifically for other platforms_ will not work with React Native. Examples include `react-select` which is built for the web and specifically targets `react-dom`, and `rimraf` which is built for Node.js and interacts with your computer file system. Other libraries like `lodash` use only JavaScript language features and work in any environment. You will gain a sense for this over time, but until then the easiest way to find out is to try it yourself. You can remove packages using `npm uninstall` if it turns out that it does not work in React Native.
+
+### Does it work for the platforms that my app supports?
+
+[React Native Directory](https://reactnative.directory) allows you to filter by platform compatibility, such as iOS, Android, Web, and Windows. If the library you would like to use is not currently listed there, refer to the README for the library to learn more.
+
+### Does it work with my app version of React Native?
+
+The latest version of a library is typically compatible with the latest version of React Native. If you are using an older version, you should refer to the README to know which version of the library you should install. You can install a particular version of the library by running `npm install @`, for example: `npm install @react-native-community/netinfo@^2.0.0`.
diff --git a/website/versioned_docs/version-0.70/linking-libraries-ios.md b/website/versioned_docs/version-0.70/linking-libraries-ios.md
new file mode 100644
index 00000000000..c7d23a5d596
--- /dev/null
+++ b/website/versioned_docs/version-0.70/linking-libraries-ios.md
@@ -0,0 +1,57 @@
+---
+id: linking-libraries-ios
+title: Linking Libraries
+---
+
+Not every app uses all the native capabilities, and including the code to support all those features would impact the binary size... But we still want to support adding these features whenever you need them.
+
+With that in mind we exposed many of these features as independent static libraries.
+
+For most of the libs it will be as quick as dragging two files, sometimes a third step will be necessary, but no more than that.
+
+:::note
+All the libraries we ship with React Native live in the `Libraries` folder in the root of the repository. Some of them are pure JavaScript, and you only need to `require` it.
+Other libraries also rely on some native code, in that case you'll have to add these files to your app, otherwise the app will throw an error as soon as you try to use the library.
+:::
+
+## Here are the few steps to link your libraries that contain native code
+
+### Automatic linking
+
+Install a library with native dependencies:
+
+```shell
+npm install --save
+```
+
+:::info
+`--save` or `--save-dev` flag is very important for this step. React Native will link your libs based on `dependencies` and `devDependencies` in your `package.json` file.
+:::
+
+That's it! Next time you build your app the native code will be linked thanks to the [autolinking](https://github.com/react-native-community/cli/blob/main/docs/autolinking.md) mechanism.
+
+### Manual linking
+
+#### Step 1
+
+If the library has native code, there must be an `.xcodeproj` file inside its folder. Drag this file to your project on Xcode (usually under the `Libraries` group on Xcode);
+
+
+
+#### Step 2
+
+Click on your main project file (the one that represents the `.xcodeproj`) select `Build Phases` and drag the static library from the `Products` folder inside the Library you are importing to `Link Binary With Libraries`
+
+
+
+#### Step 3
+
+Not every library will need this step, what you need to consider is:
+
+_Do I need to know the contents of the library at compile time?_
+
+What that means is, are you using this library on the native side or only in JavaScript? If you are only using it in JavaScript, you are good to go!
+
+If you do need to call it from native, then we need to know the library's headers. To achieve that you have to go to your project's file, select `Build Settings` and search for `Header Search Paths`. There you should include the path to your library. (This documentation used to recommend using `recursive`, but this is no longer recommended, as it can cause subtle build failures, especially with CocoaPods.)
+
+
diff --git a/website/versioned_docs/version-0.70/linking.md b/website/versioned_docs/version-0.70/linking.md
new file mode 100644
index 00000000000..a37c3d9c15c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/linking.md
@@ -0,0 +1,412 @@
+---
+id: linking
+title: Linking
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+`Linking` gives you a general interface to interact with both incoming and outgoing app links.
+
+Every Link (URL) has a URL Scheme, some websites are prefixed with `https://` or `http://` and the `http` is the URL Scheme. Let's call it scheme for short.
+
+In addition to `https`, you're likely also familiar with the `mailto` scheme. When you open a link with the mailto scheme, your operating system will open an installed mail application. Similarly, there are schemes for making phone calls and sending SMS. Read more about [built-in URL](#built-in-url-schemes) schemes below.
+
+Like using the mailto scheme, it's possible to link to other applications by using custom url schemes. For example, when you get a **Magic Link** email from Slack, the **Launch Slack** button is an anchor tag with an href that looks something like: `slack://secret/magic-login/other-secret`. Like with Slack, you can tell the operating system that you want to handle a custom scheme. When the Slack app opens, it receives the URL that was used to open it. This is often referred to as deep linking. Read more about how to [get the deep link](#get-the-deep-link) into your app.
+
+Custom URL scheme isn't the only way to open your application on mobile. You don't want to use a custom URL scheme in links in the email because then the links would be broken on desktop. Instead, you want to use a regular `https` links such as `https://www.myapp.io/records/1234546`. and on mobile you want that link open your app. Android calls it **Deep Links** (Universal Links - iOS).
+
+### Built-in URL Schemes
+
+As mentioned in the introduction, there are some URL schemes for core functionality that exist on every platform. The following is a non-exhaustive list, but covers the most commonly used schemes.
+
+| Scheme | Description | iOS | Android |
+| ---------------- | ------------------------------------------ | --- | ------- |
+| `mailto` | Open mail app, eg: mailto: support@expo.io | ✅ | ✅ |
+| `tel` | Open phone app, eg: tel:+123456789 | ✅ | ✅ |
+| `sms` | Open SMS app, eg: sms:+123456789 | ✅ | ✅ |
+| `https` / `http` | Open web browser app, eg: https://expo.io | ✅ | ✅ |
+
+### Enabling Deep Links
+
+
+
Projects with Native Code Only
+
+ The following section only applies to projects with native code exposed. If you are using the managed Expo workflow, see the guide on Linking in the Expo documentation for the appropriate alternative.
+
+
+
+If you want to enable deep links in your app, please read the below guide:
+
+
+
+
+> For instructions on how to add support for deep linking on Android, refer to [Enabling Deep Links for App Content - Add Intent Filters for Your Deep Links](http://developer.android.com/training/app-indexing/deep-linking.html#adding-filters).
+
+If you wish to receive the intent in an existing instance of MainActivity, you may set the `launchMode` of MainActivity to `singleTask` in `AndroidManifest.xml`. See [``](http://developer.android.com/guide/topics/manifest/activity-element.html) documentation for more information.
+
+```xml
+
+```
+
+
+
+
+> **NOTE:** On iOS, you'll need to add the `LinkingIOS` folder into your header search paths as described in step 3 [here](linking-libraries-ios#step-3). If you also want to listen to incoming app links during your app's execution, you'll need to add the following lines to your `*AppDelegate.m`:
+
+```objectivec
+// iOS 9.x or newer
+#import
+
+- (BOOL)application:(UIApplication *)application
+ openURL:(NSURL *)url
+ options:(NSDictionary *)options
+{
+ return [RCTLinkingManager application:application openURL:url options:options];
+}
+```
+
+If you're targeting iOS 8.x or older, you can use the following code instead:
+
+```objectivec
+// iOS 8.x or older
+#import
+
+- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
+ sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
+{
+ return [RCTLinkingManager application:application openURL:url
+ sourceApplication:sourceApplication annotation:annotation];
+}
+```
+
+If your app is using [Universal Links](https://developer.apple.com/ios/universal-links/), you'll need to add the following code as well:
+
+```objectivec
+- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
+ restorationHandler:(nonnull void (^)(NSArray> * _Nullable))restorationHandler
+{
+ return [RCTLinkingManager application:application
+ continueUserActivity:userActivity
+ restorationHandler:restorationHandler];
+}
+```
+
+
+
+
+### Handling Deep Links
+
+There are two ways to handle URLs that open your app.
+
+#### 1. If the app is already open, the app is foregrounded and a Linking 'url' event is fired
+
+You can handle these events with `Linking.addEventListener('url', callback)` - it calls `callback({ url })` with the linked URL
+
+#### 2. If the app is not already open, it is opened and the url is passed in as the initialURL
+
+You can handle these events with `Linking.getInitialURL()` - it returns a Promise that resolves to the URL, if there is one.
+
+---
+
+## Example
+
+### Open Links and Deep Links (Universal Links)
+
+```SnackPlayer name=Linking%20Function%20Component%20Example&supportedPlatforms=ios,android
+import React, { useCallback } from "react";
+import { Alert, Button, Linking, StyleSheet, View } from "react-native";
+
+const supportedURL = "https://google.com";
+
+const unsupportedURL = "slack://open?team=123456";
+
+const OpenURLButton = ({ url, children }) => {
+ const handlePress = useCallback(async () => {
+ // Checking if the link is supported for links with custom URL scheme.
+ const supported = await Linking.canOpenURL(url);
+
+ if (supported) {
+ // Opening the link with some app, if the URL scheme is "http" the web link should be opened
+ // by some browser in the mobile
+ await Linking.openURL(url);
+ } else {
+ Alert.alert(`Don't know how to open this URL: ${url}`);
+ }
+ }, [url]);
+
+ return ;
+};
+
+const App = () => {
+ return (
+
+ Open Supported URL
+ Open Unsupported URL
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: { flex: 1, justifyContent: "center", alignItems: "center" },
+});
+
+export default App;
+```
+
+### Open Custom Settings
+
+```SnackPlayer name=Linking%20Function%20Component%20Example&supportedPlatforms=ios,android
+import React, { useCallback } from "react";
+import { Button, Linking, StyleSheet, View } from "react-native";
+
+const OpenSettingsButton = ({ children }) => {
+ const handlePress = useCallback(async () => {
+ // Open the custom settings if the app has one
+ await Linking.openSettings();
+ }, []);
+
+ return ;
+};
+
+const App = () => {
+ return (
+
+ Open Settings
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: { flex: 1, justifyContent: "center", alignItems: "center" },
+});
+
+export default App;
+```
+
+### Get the Deep Link
+
+```SnackPlayer name=Linking%20Function%20Component%20Example&supportedPlatforms=ios,android
+import React, { useState, useEffect } from "react";
+import { Linking, StyleSheet, Text, View } from "react-native";
+
+const useMount = func => useEffect(() => func(), []);
+
+const useInitialURL = () => {
+ const [url, setUrl] = useState(null);
+ const [processing, setProcessing] = useState(true);
+
+ useMount(() => {
+ const getUrlAsync = async () => {
+ // Get the deep link used to open the app
+ const initialUrl = await Linking.getInitialURL();
+
+ // The setTimeout is just for testing purpose
+ setTimeout(() => {
+ setUrl(initialUrl);
+ setProcessing(false);
+ }, 1000);
+ };
+
+ getUrlAsync();
+ });
+
+ return { url, processing };
+};
+
+const App = () => {
+ const { url: initialUrl, processing } = useInitialURL();
+
+ return (
+
+
+ {processing
+ ? `Processing the initial url from a deep link`
+ : `The deep link is: ${initialUrl || "None"}`}
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: { flex: 1, justifyContent: "center", alignItems: "center" },
+});
+
+export default App;
+```
+
+### Send Intents (Android)
+
+```SnackPlayer name=Linking%20Function%20Component%20Example&supportedPlatforms=android
+import React, { useCallback } from "react";
+import { Alert, Button, Linking, StyleSheet, View } from "react-native";
+
+const SendIntentButton = ({ action, extras, children }) => {
+ const handlePress = useCallback(async () => {
+ try {
+ await Linking.sendIntent(action, extras);
+ } catch (e) {
+ Alert.alert(e.message);
+ }
+ }, [action, extras]);
+
+ return ;
+};
+
+const App = () => {
+ return (
+
+
+ Power Usage Summary
+
+
+ App Notification Settings
+
+
+ );
+};
+
+const styles = StyleSheet.create({
+ container: { flex: 1, justifyContent: "center", alignItems: "center" },
+});
+
+export default App;
+```
+
+# Reference
+
+## Methods
+
+### `addEventListener()`
+
+```jsx
+addEventListener(type, handler);
+```
+
+Add a handler to Linking changes by listening to the `url` event type and providing the handler.
+
+---
+
+### `canOpenURL()`
+
+```jsx
+canOpenURL(url);
+```
+
+Determine whether or not an installed app can handle a given URL.
+
+The method returns a `Promise` object. When it is determined whether or not the given URL can be handled, the promise is resolved and the first parameter is whether or not it can be opened.
+
+The `Promise` will reject on Android if it was impossible to check if the URL can be opened or when targetting Android 11 (SDK 30) if you didn't specify the relevant intent queries in `AndroidManifest.xml`. Similarly on iOS, the promise will reject if you didn't add the specific scheme in the `LSApplicationQueriesSchemes` key inside `Info.plist` (see bellow).
+
+**Parameters:**
+
+| Name | Type | Description |
+| -------------------------------------------------------- | ------ | ---------------- |
+| url
Required
| string | The URL to open. |
+
+> For web URLs, the protocol (`"http://"`, `"https://"`) must be set accordingly!
+
+> This method has limitations on iOS 9+. From [the official Apple documentation](https://developer.apple.com/documentation/uikit/uiapplication/1622952-canopenurl):
+>
+> - If your app is linked against an earlier version of iOS but is running in iOS 9.0 or later, you can call this method up to 50 times. After reaching that limit, subsequent calls always resolve to `false`. If the user reinstalls or upgrades the app, iOS resets the limit.
+>
+> As of iOS 9, your app also needs to provide the `LSApplicationQueriesSchemes` key inside `Info.plist` or `canOpenURL()` will always resolve to `false`.
+
+> When targeting Android 11 (SDK 30) you must specify the intents for the schemes you want to handle in `AndroidManifest.xml`. A list of common intents can be found [here](https://developer.android.com/guide/components/intents-common).
+>
+> For example to handle `https` schemes the following needs to be added to your manifest:
+>
+> ```
+>
+>
+>
+>
+>
+>
+>
+>
+> ```
+
+---
+
+### `getInitialURL()`
+
+```jsx
+getInitialURL();
+```
+
+If the app launch was triggered by an app link, it will give the link url, otherwise it will give `null`.
+
+> To support deep linking on Android, refer http://developer.android.com/training/app-indexing/deep-linking.html#handling-intents
+
+> getInitialURL may return `null` while debugging is enabled. Disable the debugger to ensure it gets passed.
+
+---
+
+### `openSettings()`
+
+```jsx
+openSettings();
+```
+
+Open the Settings app and displays the app’s custom settings, if it has any.
+
+---
+
+### `openURL()`
+
+```jsx
+openURL(url);
+```
+
+Try to open the given `url` with any of the installed apps.
+
+You can use other URLs, like a location (e.g. "geo:37.484847,-122.148386" on Android or "http://maps.apple.com/?ll=37.484847,-122.148386" on iOS), a contact, or any other URL that can be opened with the installed apps.
+
+The method returns a `Promise` object. If the user confirms the open dialog or the url automatically opens, the promise is resolved. If the user cancels the open dialog or there are no registered applications for the url, the promise is rejected.
+
+**Parameters:**
+
+| Name | Type | Description |
+| -------------------------------------------------------- | ------ | ---------------- |
+| url
Required
| string | The URL to open. |
+
+> This method will fail if the system doesn't know how to open the specified URL. If you're passing in a non-http(s) URL, it's best to check `canOpenURL()` first.
+
+> For web URLs, the protocol (`"http://"`, `"https://"`) must be set accordingly!
+
+> This method may behave differently in a simulator e.g. `"tel:"` links are not able to be handled in the iOS simulator as there's no access to the dialer app.
+
+---
+
+### `removeEventListener()`
+
+```jsx
+removeEventListener(type, handler);
+```
+
+> **Deprecated.** Use the `remove()` method on the event subscription returned by [`addEventListener()`](#addeventlistener).
+
+---
+
+### `sendIntent()`
Android
+
+```jsx
+sendIntent(action, extras);
+```
+
+Launch an Android intent with extras.
+
+**Parameters:**
+
+| Name | Type |
+| ----------------------------------------------------------- | ------------------------------------------------------------ |
+| action
+
+The `hardwareAccelerated` prop controls whether to force hardware acceleration for the underlying window.
+
+| Type | Default |
+| ---- | ------- |
+| bool | `false` |
+
+---
+
+### `onDismiss`
iOS
+
+The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed.
+
+| Type |
+| -------- |
+| function |
+
+---
+
+### `onOrientationChange`
iOS
+
+The `onOrientationChange` callback is called when the orientation changes while the modal is being displayed. The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.
+
+| Type |
+| -------- |
+| function |
+
+---
+
+### `onRequestClose`
+
+The `onRequestClose` callback is called when the user taps the hardware back button on Android or the menu button on Apple TV. Because of this required prop, be aware that `BackHandler` events will not be emitted as long as the modal is open.
+On iOS, this callback is called when a Modal is being dismissed using a drag gesture when `presentationStyle` is `pageSheet or formSheet`
+
+| Type |
+| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| function
Required
Android
TV
function
iOS
|
+
+---
+
+### `onShow`
+
+The `onShow` prop allows passing a function that will be called once the modal has been shown.
+
+| Type |
+| -------- |
+| function |
+
+---
+
+### `presentationStyle`
iOS
+
+The `presentationStyle` prop controls how the modal appears (generally on larger devices such as iPad or plus-sized iPhones). See https://developer.apple.com/reference/uikit/uimodalpresentationstyle for details.
+
+Possible values:
+
+- `fullScreen` covers the screen completely
+- `pageSheet` covers portrait-width view centered (only on larger devices)
+- `formSheet` covers narrow-width view centered (only on larger devices)
+- `overFullScreen` covers the screen completely, but allows transparency
+
+| Type | Default |
+| ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
+| enum(`'fullScreen'`, `'pageSheet'`, `'formSheet'`, `'overFullScreen'`) | `fullScreen` if `transparent={false}``overFullScreen` if `transparent={true}` |
+
+---
+
+### `statusBarTranslucent`
Android
+
+The `statusBarTranslucent` prop determines whether your modal should go under the system statusbar.
+
+| Type | Default |
+| ---- | ------- |
+| bool | `false` |
+
+---
+
+### `supportedOrientations`
iOS
+
+The `supportedOrientations` prop allows the modal to be rotated to any of the specified orientations. On iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field.
+
+> When using `presentationStyle` of `pageSheet` or `formSheet`, this property will be ignored by iOS.
+
+| Type | Default |
+| -------------------------------------------------------------------------------------------------------------- | -------------- |
+| array of enums(`'portrait'`, `'portrait-upside-down'`, `'landscape'`, `'landscape-left'`, `'landscape-right'`) | `['portrait']` |
+
+---
+
+### `transparent`
+
+The `transparent` prop determines whether your modal will fill the entire view. Setting this to `true` will render the modal over a transparent background.
+
+| Type | Default |
+| ---- | ------- |
+| bool | `false` |
+
+---
+
+### `visible`
+
+The `visible` prop determines whether your modal is visible.
+
+| Type | Default |
+| ---- | ------- |
+| bool | `true` |
diff --git a/website/versioned_docs/version-0.70/more-resources.md b/website/versioned_docs/version-0.70/more-resources.md
new file mode 100644
index 00000000000..2f775cee371
--- /dev/null
+++ b/website/versioned_docs/version-0.70/more-resources.md
@@ -0,0 +1,43 @@
+---
+id: more-resources
+title: More Resources
+---
+
+There’s always more to learn: developer workflows, shipping to app stores, internationalization, security and more.
+
+## Where to go from here
+
+- [Set up your environment](environment-setup)
+- [Set up your development workflow](running-on-device)
+- [Design and layout your app](flexbox)
+- [Debug your app](debugging)
+- [Make your app cross platform](platform-specific-code)
+- [Get involved in the React Native community](/help)
+
+## Dive deep
+
+- [React’s Documentation](https://reactjs.org/docs/hello-world.html)
+- [MDN’s JavaScript tutorials, reference, and guides](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
+- [Android](https://developer.android.com/docs) and [iOS](https://developer.apple.com/documentation/uikit) platform docs
+
+## IDEs
+
+We recommend using the [VS Code](https://code.visualstudio.com/) code editor and its handy [React Native tools](https://marketplace.visualstudio.com/items?itemName=msjsdiag.vscode-react-native).
+
+## Platforms to try
+
+[Expo](https://docs.expo.dev/) is a framework of tools and services for React Native that focuses on helping you build, ship, and iterate on your app, to use preview deployment workflows that are popular with web development, and to automate your development workflows. Expo also makes it possible to build React Native apps without ever touching Xcode or Android Studio, and it doesn't get in the way if you want to use those tools.
+
+[Ignite](https://github.com/infinitered/ignite) is a starter kit CLI with several React Native boilerplates. The latest, [Ignite Bowser](https://github.com/infinitered/ignite-bowser), uses MobX-State-Tree for state management, React Navigation, and other common libraries. It has generators for components, models, and more, and supports Expo out of the box. If you are looking for a preconfigured tech stack, Ignite could be perfect for you.
+
+## Example Apps
+
+Try out apps from the [Showcase](https://reactnative.dev/showcase) to see what React Native is capable of! Looking for something more hands on? Check out this [set of example apps on GitHub](https://github.com/ReactNativeNews/React-Native-Apps). You can look at their source code—try running one on a simulator or device.
+
+## Find, make, and share your own Native Components and TurboModules
+
+React Native has a community of thousands of developers like you making content, tools, tutorials—and Native Components!
+
+Can’t find what you’re looking for in the Core Components? Visit [React Native Directory](https://reactnative.directory) to find what the community has been creating.
+
+Interested in making your own Native Component or Module? Making modules for your own use case and sharing them with others on NPM and GitHub helps grow the React Native ecosystem and community! Read the guides to making your own Native Modules ([Android](native-modules-android.md), [iOS](native-modules-ios.md)) and Native Components ([Android](native-components-android.md), [iOS](native-components-ios.md)).
diff --git a/website/versioned_docs/version-0.70/native-components-android.md b/website/versioned_docs/version-0.70/native-components-android.md
new file mode 100644
index 00000000000..51b2e302678
--- /dev/null
+++ b/website/versioned_docs/version-0.70/native-components-android.md
@@ -0,0 +1,867 @@
+---
+id: native-components-android
+title: Android Native UI Components
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
+
+
+
+There are tons of native UI widgets out there ready to be used in the latest apps - some of them are part of the platform, others are available as third-party libraries, and still more might be in use in your very own portfolio. React Native has several of the most critical platform components already wrapped, like `ScrollView` and `TextInput`, but not all of them, and certainly not ones you might have written yourself for a previous app. Fortunately, we can wrap up these existing components for seamless integration with your React Native application.
+
+Like the native module guide, this too is a more advanced guide that assumes you are somewhat familiar with Android SDK programming. This guide will show you how to build a native UI component, walking you through the implementation of a subset of the existing `ImageView` component available in the core React Native library.
+
+## ImageView example
+
+For this example we are going to walk through the implementation requirements to allow the use of ImageViews in JavaScript.
+
+Native views are created and manipulated by extending `ViewManager` or more commonly `SimpleViewManager` . A `SimpleViewManager` is convenient in this case because it applies common properties such as background color, opacity, and Flexbox layout.
+
+These subclasses are essentially singletons - only one instance of each is created by the bridge. They send native views to the `NativeViewHierarchyManager`, which delegates back to them to set and update the properties of the views as necessary. The `ViewManagers` are also typically the delegates for the views, sending events back to JavaScript via the bridge.
+
+To send a view:
+
+1. Create the ViewManager subclass.
+2. Implement the `createViewInstance` method
+3. Expose view property setters using `@ReactProp` (or `@ReactPropGroup`) annotation
+4. Register the manager in `createViewManagers` of the applications package.
+5. Implement the JavaScript module
+
+### 1. Create the `ViewManager` subclass
+
+In this example we create view manager class `ReactImageManager` that extends `SimpleViewManager` of type `ReactImageView`. `ReactImageView` is the type of object managed by the manager, this will be the custom native view. Name returned by `getName` is used to reference the native view type from JavaScript.
+
+
+
+
+```kotlin
+class ReactImageManager(
+ private val callerContext: ReactApplicationContext
+) : SimpleViewManager() {
+
+ override fun getName() = REACT_CLASS
+
+ companion object {
+ const val REACT_CLASS = "RCTImageView"
+ }
+}
+```
+
+
+
+
+```java
+public class ReactImageManager extends SimpleViewManager {
+
+ public static final String REACT_CLASS = "RCTImageView";
+ ReactApplicationContext mCallerContext;
+
+ public ReactImageManager(ReactApplicationContext reactContext) {
+ mCallerContext = reactContext;
+ }
+
+ @Override
+ public String getName() {
+ return REACT_CLASS;
+ }
+}
+```
+
+
+
+
+### 2. Implement method `createViewInstance`
+
+Views are created in the `createViewInstance` method, the view should initialize itself in its default state, any properties will be set via a follow up call to `updateView.`
+
+
+
+
+```kotlin
+ override fun createViewInstance(context: ThemedReactContext) =
+ ReactImageView(context, Fresco.newDraweeControllerBuilder(), null, callerContext)
+```
+
+
+
+
+```java
+ @Override
+ public ReactImageView createViewInstance(ThemedReactContext context) {
+ return new ReactImageView(context, Fresco.newDraweeControllerBuilder(), null, mCallerContext);
+ }
+```
+
+
+
+
+### 3. Expose view property setters using `@ReactProp` (or `@ReactPropGroup`) annotation
+
+Properties that are to be reflected in JavaScript needs to be exposed as setter method annotated with `@ReactProp` (or `@ReactPropGroup`). Setter method should take view to be updated (of the current view type) as a first argument and property value as a second argument. Setter should be public and not return a value (i.e. return type should be `void` in Java or `Unit` in Kotlin). Property type sent to JS is determined automatically based on the type of value argument of the setter. The following type of values are currently supported (in Java): `boolean`, `int`, `float`, `double`, `String`, `Boolean`, `Integer`, `ReadableArray`, `ReadableMap`. The corresponding types in Kotlin are `Boolean`, `Int`, `Float`, `Double`, `String`, `ReadableArray`, `ReadableMap`.
+
+Annotation `@ReactProp` has one obligatory argument `name` of type `String`. Name assigned to the `@ReactProp` annotation linked to the setter method is used to reference the property on JS side.
+
+Except from `name`, `@ReactProp` annotation may take following optional arguments: `defaultBoolean`, `defaultInt`, `defaultFloat`. Those arguments should be of the corresponding type (accordingly `boolean`, `int`, `float` in Java and `Boolean`, `Int`, `Float` in Kotlin) and the value provided will be passed to the setter method in case when the property that the setter is referencing has been removed from the component. Note that "default" values are only provided for primitive types, in case when setter is of some complex type, `null` will be provided as a default value in case when corresponding property gets removed.
+
+Setter declaration requirements for methods annotated with `@ReactPropGroup` are different than for `@ReactProp`, please refer to the `@ReactPropGroup` annotation class docs for more information about it. **IMPORTANT!** in ReactJS updating the property value will result in setter method call. Note that one of the ways we can update component is by removing properties that have been set before. In that case setter method will be called as well to notify view manager that property has changed. In that case "default" value will be provided (for primitive types "default" value can be specified using `defaultBoolean`, `defaultFloat`, etc. arguments of `@ReactProp` annotation, for complex types setter will be called with value set to `null`).
+
+
+
+
+```kotlin
+ @ReactProp(name = "src")
+ fun setSrc(view: ReactImageView, sources: ReadableArray?) {
+ view.setSource(sources)
+ }
+
+ @ReactProp(name = "borderRadius", defaultFloat = 0f)
+ override fun setBorderRadius(view: ReactImageView, borderRadius: Float) {
+ view.setBorderRadius(borderRadius)
+ }
+
+ @ReactProp(name = ViewProps.RESIZE_MODE)
+ fun setResizeMode(view: ReactImageView, resizeMode: String?) {
+ view.setScaleType(ImageResizeMode.toScaleType(resizeMode))
+ }
+```
+
+
+
+
+```java
+ @ReactProp(name = "src")
+ public void setSrc(ReactImageView view, @Nullable ReadableArray sources) {
+ view.setSource(sources);
+ }
+
+ @ReactProp(name = "borderRadius", defaultFloat = 0f)
+ public void setBorderRadius(ReactImageView view, float borderRadius) {
+ view.setBorderRadius(borderRadius);
+ }
+
+ @ReactProp(name = ViewProps.RESIZE_MODE)
+ public void setResizeMode(ReactImageView view, @Nullable String resizeMode) {
+ view.setScaleType(ImageResizeMode.toScaleType(resizeMode));
+ }
+```
+
+
+
+
+### 4. Register the `ViewManager`
+
+The final step is to register the ViewManager to the application, this happens in a similar way to [Native Modules](native-modules-android.md), via the applications package member function `createViewManagers`.
+
+
+
+
+```kotlin
+ override fun createViewManagers(
+ reactContext: ReactApplicationContext
+ ) = listOf(ReactImageManager(reactContext))
+```
+
+
+
+
+```java
+ @Override
+ public List createViewManagers(
+ ReactApplicationContext reactContext) {
+ return Arrays.asList(
+ new ReactImageManager(reactContext)
+ );
+ }
+```
+
+
+
+
+### 5. Implement the JavaScript module
+
+The very final step is to create the JavaScript module that defines the interface layer between Java/Kotlin and JavaScript for the users of your new view. It is recommended for you to document the component interface in this module (e.g. using Flow, TypeScript, or plain old comments).
+
+```jsx title="ImageView.js"
+import { requireNativeComponent } from 'react-native';
+
+/**
+ * Composes `View`.
+ *
+ * - src: string
+ * - borderRadius: number
+ * - resizeMode: 'cover' | 'contain' | 'stretch'
+ */
+module.exports = requireNativeComponent('RCTImageView');
+```
+
+The `requireNativeComponent` function takes the name of the native view. Note that if your component needs to do anything more sophisticated (e.g. custom event handling), you should wrap the native component in another React component. This is illustrated in the `MyCustomView` example below.
+
+## Events
+
+So now we know how to expose native view components that we can control freely from JS, but how do we deal with events from the user, like pinch-zooms or panning? When a native event occurs the native code should issue an event to the JavaScript representation of the View, and the two views are linked with the value returned from the `getId()` method.
+
+
+
+
+```kotlin
+class MyCustomView(context: Context) : View(context) {
+ ...
+ fun onReceiveNativeEvent() {
+ val event = Arguments.createMap().apply {
+ putString("message", "MyMessage")
+ }
+ val reactContext = context as ReactContext
+ reactContext
+ .getJSModule(RCTEventEmitter::class.java)
+ .receiveEvent(id, "topChange", event)
+ }
+}
+```
+
+
+
+
+```java
+class MyCustomView extends View {
+ ...
+ public void onReceiveNativeEvent() {
+ WritableMap event = Arguments.createMap();
+ event.putString("message", "MyMessage");
+ ReactContext reactContext = (ReactContext)getContext();
+ reactContext
+ .getJSModule(RCTEventEmitter.class)
+ .receiveEvent(getId(), "topChange", event);
+ }
+}
+```
+
+
+
+
+To map the `topChange` event name to the `onChange` callback prop in JavaScript, register it by overriding the `getExportedCustomBubblingEventTypeConstants` method in your `ViewManager`:
+
+
+
+
+```kotlin
+class ReactImageManager : SimpleViewManager() {
+ ...
+ override fun getExportedCustomBubblingEventTypeConstants(): Map {
+ return mapOf(
+ "topChange" to mapOf(
+ "phasedRegistrationNames" to mapOf(
+ "bubbled" to "onChange"
+ )
+ )
+ )
+ }
+}
+```
+
+
+
+
+```java
+public class ReactImageManager extends SimpleViewManager {
+ ...
+ public Map getExportedCustomBubblingEventTypeConstants() {
+ return MapBuilder.builder().put(
+ "topChange",
+ MapBuilder.of(
+ "phasedRegistrationNames",
+ MapBuilder.of("bubbled", "onChange")
+ )
+ ).build();
+ }
+}
+```
+
+
+
+
+This callback is invoked with the raw event, which we typically process in the wrapper component to make a simpler API:
+
+```jsx title="MyCustomView.js"
+class MyCustomView extends React.Component {
+ constructor(props) {
+ super(props);
+ this._onChange = this._onChange.bind(this);
+ }
+ _onChange(event) {
+ if (!this.props.onChangeMessage) {
+ return;
+ }
+ this.props.onChangeMessage(event.nativeEvent.message);
+ }
+ render() {
+ return ;
+ }
+}
+MyCustomView.propTypes = {
+ /**
+ * Callback that is called continuously when the user is dragging the map.
+ */
+ onChangeMessage: PropTypes.func,
+ ...
+};
+
+const RCTMyCustomView = requireNativeComponent(`RCTMyCustomView`);
+```
+
+## Integration with an Android Fragment example
+
+In order to integrate existing Native UI elements to your React Native app, you might need to use Android Fragments to give you a more granular control over your native component than returning a `View` from your `ViewManager`. You will need this if you want to add custom logic that is tied to your view with the help of [lifecycle methods](https://developer.android.com/guide/fragments/lifecycle), such as `onViewCreated`, `onPause`, `onResume`. The following steps will show you how to do it:
+
+### 1. Create an example custom view
+
+First, let's create a `CustomView` class which extends `FrameLayout` (the content of this view can be any view that you'd like to render)
+
+
+
+
+```kotlin title="CustomView.kt"
+// replace with your package
+package com.mypackage
+
+import android.content.Context
+import android.graphics.Color
+import android.widget.FrameLayout
+import android.widget.TextView
+
+class CustomView(context: Context) : FrameLayout(context) {
+ init {
+ // set padding and background color
+ setPadding(16,16,16,16)
+ setBackgroundColor(Color.parseColor("#5FD3F3"))
+
+ // add default text view
+ addView(TextView(context).apply {
+ text = "Welcome to Android Fragments with React Native."
+ })
+ }
+}
+```
+
+
+
+
+```java title="CustomView.java"
+// replace with your package
+package com.mypackage;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+
+public class CustomView extends FrameLayout {
+ public CustomView(@NonNull Context context) {
+ super(context);
+ // set padding and background color
+ this.setPadding(16,16,16,16);
+ this.setBackgroundColor(Color.parseColor("#5FD3F3"));
+
+ // add default text view
+ TextView text = new TextView(context);
+ text.setText("Welcome to Android Fragments with React Native.");
+ this.addView(text);
+ }
+}
+```
+
+
+
+
+### 2. Create a `Fragment`
+
+
+
+
+```kotlin title="MyFragment.kt"
+// replace with your package
+package com.mypackage
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.Fragment
+
+// replace with your view's import
+import com.mypackage.CustomView
+
+class MyFragment : Fragment() {
+ private lateinit var customView: CustomView
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
+ super.onCreateView(inflater, container, savedInstanceState)
+ customView = CustomView(requireNotNull(context))
+ return customView // this CustomView could be any view that you want to render
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ // do any logic that should happen in an `onCreate` method, e.g:
+ // customView.onCreate(savedInstanceState);
+ }
+
+ override fun onPause() {
+ super.onPause()
+ // do any logic that should happen in an `onPause` method
+ // e.g.: customView.onPause();
+ }
+
+ override fun onResume() {
+ super.onResume()
+ // do any logic that should happen in an `onResume` method
+ // e.g.: customView.onResume();
+ }
+
+ override fun onDestroy() {
+ super.onDestroy()
+ // do any logic that should happen in an `onDestroy` method
+ // e.g.: customView.onDestroy();
+ }
+}
+```
+
+
+
+
+```java title="MyFragment.java"
+// replace with your package
+package com.mypackage;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import androidx.fragment.app.Fragment;
+
+// replace with your view's import
+import com.mypackage.CustomView;
+
+public class MyFragment extends Fragment {
+ CustomView customView;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
+ super.onCreateView(inflater, parent, savedInstanceState);
+ customView = new CustomView(this.getContext());
+ return customView; // this CustomView could be any view that you want to render
+ }
+
+ @Override
+ public void onViewCreated(View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
+ // do any logic that should happen in an `onCreate` method, e.g:
+ // customView.onCreate(savedInstanceState);
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ // do any logic that should happen in an `onPause` method
+ // e.g.: customView.onPause();
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ // do any logic that should happen in an `onResume` method
+ // e.g.: customView.onResume();
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ // do any logic that should happen in an `onDestroy` method
+ // e.g.: customView.onDestroy();
+ }
+}
+```
+
+
+
+
+### 3. Create the `ViewManager` subclass
+
+
+
+
+```kotlin title="MyViewManager.kt"
+// replace with your package
+package com.mypackage
+
+import android.view.Choreographer
+import android.view.View
+import android.view.ViewGroup
+import android.widget.FrameLayout
+import androidx.fragment.app.FragmentActivity
+import com.facebook.react.bridge.ReactApplicationContext
+import com.facebook.react.bridge.ReadableArray
+import com.facebook.react.uimanager.ThemedReactContext
+import com.facebook.react.uimanager.ViewGroupManager
+import com.facebook.react.uimanager.annotations.ReactPropGroup
+
+class MyViewManager(
+ private val reactContext: ReactApplicationContext
+) : ViewGroupManager() {
+ private var propWidth: Int? = null
+ private var propHeight: Int? = null
+
+ override fun getName() = REACT_CLASS
+
+ /**
+ * Return a FrameLayout which will later hold the Fragment
+ */
+ override fun createViewInstance(reactContext: ThemedReactContext) =
+ FrameLayout(reactContext)
+
+ /**
+ * Map the "create" command to an integer
+ */
+ override fun getCommandsMap() = mapOf("create" to COMMAND_CREATE)
+
+ /**
+ * Handle "create" command (called from JS) and call createFragment method
+ */
+ override fun receiveCommand(
+ root: FrameLayout,
+ commandId: String,
+ args: ReadableArray?
+ ) {
+ super.receiveCommand(root, commandId, args)
+ val reactNativeViewId = requireNotNull(args).getInt(0)
+
+ when (commandId.toInt()) {
+ COMMAND_CREATE -> createFragment(root, reactNativeViewId)
+ }
+ }
+
+ @ReactPropGroup(names = ["width", "height"], customType = "Style")
+ fun setStyle(view: FrameLayout, index: Int, value: Int) {
+ if (index == 0) propWidth = value
+ if (index == 1) propHeight = value
+ }
+
+ /**
+ * Replace your React Native view with a custom fragment
+ */
+ fun createFragment(root: FrameLayout, reactNativeViewId: Int) {
+ val parentView = root.findViewById(reactNativeViewId)
+ setupLayout(parentView)
+
+ val myFragment = MyFragment()
+ val activity = reactContext.currentActivity as FragmentActivity
+ activity.supportFragmentManager
+ .beginTransaction()
+ .replace(reactNativeViewId, myFragment, reactNativeViewId.toString())
+ .commit()
+ }
+
+ fun setupLayout(view: View) {
+ Choreographer.getInstance().postFrameCallback(object: Choreographer.FrameCallback {
+ override fun doFrame(frameTimeNanos: Long) {
+ manuallyLayoutChildren(view)
+ view.viewTreeObserver.dispatchOnGlobalLayout()
+ Choreographer.getInstance().postFrameCallback(this)
+ }
+ })
+ }
+
+ /**
+ * Layout all children properly
+ */
+ private fun manuallyLayoutChildren(view: View) {
+ // propWidth and propHeight coming from react-native props
+ val width = requireNotNull(propWidth)
+ val height = requireNotNull(propHeight)
+
+ view.measure(
+ View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
+ View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY))
+
+ view.layout(0, 0, width, height)
+ }
+
+ companion object {
+ private const val REACT_CLASS = "MyViewManager"
+ private const val COMMAND_CREATE = 1
+ }
+}
+```
+
+
+
+
+```java title="MyViewManager.java"
+// replace with your package
+package com.mypackage;
+
+import android.view.Choreographer;
+import android.view.View;
+import android.widget.FrameLayout;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.fragment.app.FragmentActivity;
+
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReadableArray;
+import com.facebook.react.common.MapBuilder;
+import com.facebook.react.uimanager.annotations.ReactProp;
+import com.facebook.react.uimanager.annotations.ReactPropGroup;
+import com.facebook.react.uimanager.ViewGroupManager;
+import com.facebook.react.uimanager.ThemedReactContext;
+
+import java.util.Map;
+
+public class MyViewManager extends ViewGroupManager {
+
+ public static final String REACT_CLASS = "MyViewManager";
+ public final int COMMAND_CREATE = 1;
+ private int propWidth;
+ private int propHeight;
+
+ ReactApplicationContext reactContext;
+
+ public MyViewManager(ReactApplicationContext reactContext) {
+ this.reactContext = reactContext;
+ }
+
+ @Override
+ public String getName() {
+ return REACT_CLASS;
+ }
+
+ /**
+ * Return a FrameLayout which will later hold the Fragment
+ */
+ @Override
+ public FrameLayout createViewInstance(ThemedReactContext reactContext) {
+ return new FrameLayout(reactContext);
+ }
+
+ /**
+ * Map the "create" command to an integer
+ */
+ @Nullable
+ @Override
+ public Map getCommandsMap() {
+ return MapBuilder.of("create", COMMAND_CREATE);
+ }
+
+ /**
+ * Handle "create" command (called from JS) and call createFragment method
+ */
+ @Override
+ public void receiveCommand(
+ @NonNull FrameLayout root,
+ String commandId,
+ @Nullable ReadableArray args
+ ) {
+ super.receiveCommand(root, commandId, args);
+ int reactNativeViewId = args.getInt(0);
+ int commandIdInt = Integer.parseInt(commandId);
+
+ switch (commandIdInt) {
+ case COMMAND_CREATE:
+ createFragment(root, reactNativeViewId);
+ break;
+ default: {}
+ }
+ }
+
+ @ReactPropGroup(names = {"width", "height"}, customType = "Style")
+ public void setStyle(FrameLayout view, int index, Integer value) {
+ if (index == 0) {
+ propWidth = value;
+ }
+
+ if (index == 1) {
+ propHeight = value;
+ }
+ }
+
+ /**
+ * Replace your React Native view with a custom fragment
+ */
+ public void createFragment(FrameLayout root, int reactNativeViewId) {
+ ViewGroup parentView = (ViewGroup) root.findViewById(reactNativeViewId);
+ setupLayout(parentView);
+
+ final MyFragment myFragment = new MyFragment();
+ FragmentActivity activity = (FragmentActivity) reactContext.getCurrentActivity();
+ activity.getSupportFragmentManager()
+ .beginTransaction()
+ .replace(reactNativeViewId, myFragment, String.valueOf(reactNativeViewId))
+ .commit();
+ }
+
+ public void setupLayout(View view) {
+ Choreographer.getInstance().postFrameCallback(new Choreographer.FrameCallback() {
+ @Override
+ public void doFrame(long frameTimeNanos) {
+ manuallyLayoutChildren(view);
+ view.getViewTreeObserver().dispatchOnGlobalLayout();
+ Choreographer.getInstance().postFrameCallback(this);
+ }
+ });
+ }
+
+ /**
+ * Layout all children properly
+ */
+ public void manuallyLayoutChildren(View view) {
+ // propWidth and propHeight coming from react-native props
+ int width = propWidth;
+ int height = propHeight;
+
+ view.measure(
+ View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY),
+ View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY));
+
+ view.layout(0, 0, width, height);
+ }
+}
+```
+
+
+
+
+### 4. Register the `ViewManager`
+
+
+
+
+```kotlin title="MyPackage.kt"
+// replace with your package
+package com.mypackage
+
+import com.facebook.react.ReactPackage
+import com.facebook.react.bridge.ReactApplicationContext
+import com.facebook.react.uimanager.ViewManager
+
+class MyPackage : ReactPackage {
+ ...
+ override fun createViewManagers(
+ reactContext: ReactApplicationContext
+ ) = listOf(MyViewManager(reactContext))
+}
+```
+
+
+
+
+```java title="MyPackage.java"
+// replace with your package
+package com.mypackage;
+
+import com.facebook.react.ReactPackage;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.uimanager.ViewManager;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class MyPackage implements ReactPackage {
+
+ @Override
+ public List createViewManagers(ReactApplicationContext reactContext) {
+ return Arrays.asList(
+ new MyViewManager(reactContext)
+ );
+ }
+
+}
+```
+
+
+
+
+### 5. Register the `Package`
+
+
+
+
+```kotlin title="MainApplication.kt"
+ override fun getPackages() = PackageList(this).packages.apply {
+ add(MyPackage())
+ }
+```
+
+
+
+
+```java title="MainApplication.java"
+ @Override
+ protected List getPackages() {
+ List packages = new PackageList(this).getPackages();
+ ...
+ packages.add(new MyPackage());
+ return packages;
+ }
+```
+
+
+
+
+### 6. Implement the JavaScript module
+
+I. Start with custom View manager:
+
+```jsx title="MyViewManager.jsx"
+import { requireNativeComponent } from 'react-native';
+
+export const MyViewManager =
+ requireNativeComponent('MyViewManager');
+```
+
+II. Then implement custom View calling the `create` method:
+
+```jsx title="MyView.jsx"
+import React, { useEffect, useRef } from 'react';
+import {
+ PixelRatio,
+ UIManager,
+ findNodeHandle
+} from 'react-native';
+
+import { MyViewManager } from './my-view-manager';
+
+const createFragment = (viewId) =>
+ UIManager.dispatchViewManagerCommand(
+ viewId,
+ // we are calling the 'create' command
+ UIManager.MyViewManager.Commands.create.toString(),
+ [viewId]
+ );
+
+export const MyView = () => {
+ const ref = useRef(null);
+
+ useEffect(() => {
+ const viewId = findNodeHandle(ref.current);
+ createFragment(viewId);
+ }, []);
+
+ return (
+
+ );
+};
+```
+
+If you want to expose property setters using `@ReactProp` (or `@ReactPropGroup`) annotation see the [ImageView example](#imageview-example) above.
diff --git a/website/versioned_docs/version-0.70/native-components-ios.md b/website/versioned_docs/version-0.70/native-components-ios.md
new file mode 100644
index 00000000000..bba1b3559f6
--- /dev/null
+++ b/website/versioned_docs/version-0.70/native-components-ios.md
@@ -0,0 +1,496 @@
+---
+id: native-components-ios
+title: iOS Native UI Components
+---
+
+import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
+
+
+
+There are tons of native UI widgets out there ready to be used in the latest apps - some of them are part of the platform, others are available as third-party libraries, and still more might be in use in your very own portfolio. React Native has several of the most critical platform components already wrapped, like `ScrollView` and `TextInput`, but not all of them, and certainly not ones you might have written yourself for a previous app. Fortunately, we can wrap up these existing components for seamless integration with your React Native application.
+
+Like the native module guide, this too is a more advanced guide that assumes you are somewhat familiar with iOS programming. This guide will show you how to build a native UI component, walking you through the implementation of a subset of the existing `MapView` component available in the core React Native library.
+
+## iOS MapView example
+
+Let's say we want to add an interactive Map to our app - might as well use [`MKMapView`](https://developer.apple.com/library/prerelease/mac/documentation/MapKit/Reference/MKMapView_Class/index.html), we only need to make it usable from JavaScript.
+
+Native views are created and manipulated by subclasses of `RCTViewManager`. These subclasses are similar in function to view controllers, but are essentially singletons - only one instance of each is created by the bridge. They expose native views to the `RCTUIManager`, which delegates back to them to set and update the properties of the views as necessary. The `RCTViewManager`s are also typically the delegates for the views, sending events back to JavaScript via the bridge.
+
+To expose a view you can:
+
+- Subclass `RCTViewManager` to create a manager for your component.
+- Add the `RCT_EXPORT_MODULE()` marker macro.
+- Implement the `-(UIView *)view` method.
+
+```objectivec title='RNTMapManager.m'
+#import
+
+#import
+
+@interface RNTMapManager : RCTViewManager
+@end
+
+@implementation RNTMapManager
+
+RCT_EXPORT_MODULE(RNTMap)
+
+- (UIView *)view
+{
+ return [[MKMapView alloc] init];
+}
+
+@end
+```
+
+:::note
+Do not attempt to set the `frame` or `backgroundColor` properties on the `UIView` instance that you expose through the `-view` method.
+React Native will overwrite the values set by your custom class in order to match your JavaScript component's layout props.
+If you need this granularity of control it might be better to wrap the `UIView` instance you want to style in another `UIView` and return the wrapper `UIView` instead.
+See [Issue 2948](https://github.com/facebook/react-native/issues/2948) for more context.
+:::
+
+:::info
+In the example above, we prefixed our class name with `RNT`. Prefixes are used to avoid name collisions with other frameworks.
+Apple frameworks use two-letter prefixes, and React Native uses `RCT` as a prefix. In order to avoid name collisions, we recommend using a three-letter prefix other than `RCT` in your own classes.
+:::
+
+Then you need a little bit of JavaScript to make this a usable React component:
+
+```jsx title='MapView.js'
+import { requireNativeComponent } from 'react-native';
+
+// requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager'
+module.exports = requireNativeComponent('RNTMap');
+```
+
+```jsx title='MyApp.js'
+import MapView from './MapView.js';
+
+...
+
+render() {
+ return ;
+}
+```
+
+Make sure to use `RNTMap` here. We want to require the manager here, which will expose the view of our manager for use in JavaScript.
+
+:::note
+When rendering, don't forget to stretch the view, otherwise you'll be staring at a blank screen.
+:::
+
+```jsx
+ render() {
+ return ;
+ }
+```
+
+This is now a fully-functioning native map view component in JavaScript, complete with pinch-zoom and other native gesture support. We can't really control it from JavaScript yet, though :(
+
+## Properties
+
+The first thing we can do to make this component more usable is to bridge over some native properties. Let's say we want to be able to disable zooming and specify the visible region. Disabling zoom is a boolean, so we add this one line:
+
+```objectivec title='RNTMapManager.m'
+RCT_EXPORT_VIEW_PROPERTY(zoomEnabled, BOOL)
+```
+
+Note that we explicitly specify the type as `BOOL` - React Native uses `RCTConvert` under the hood to convert all sorts of different data types when talking over the bridge, and bad values will show convenient "RedBox" errors to let you know there is an issue ASAP. When things are straightforward like this, the whole implementation is taken care of for you by this macro.
+
+Now to actually disable zooming, we set the property in JS:
+
+```jsx title='MyApp.js'
+
+```
+
+To document the properties (and which values they accept) of our MapView component we'll add a wrapper component and document the interface with React `PropTypes`:
+
+```jsx title='MapView.js'
+import PropTypes from 'prop-types';
+import React from 'react';
+import { requireNativeComponent } from 'react-native';
+
+class MapView extends React.Component {
+ render() {
+ return ;
+ }
+}
+
+MapView.propTypes = {
+ /**
+ * A Boolean value that determines whether the user may use pinch
+ * gestures to zoom in and out of the map.
+ */
+ zoomEnabled: PropTypes.bool
+};
+
+var RNTMap = requireNativeComponent('RNTMap');
+
+module.exports = MapView;
+```
+
+Now we have a nicely documented wrapper component to work with.
+
+Next, let's add the more complex `region` prop. We start by adding the native code:
+
+```objectivec title='RNTMapManager.m'
+RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, MKMapView)
+{
+ [view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
+}
+```
+
+Ok, this is more complicated than the `BOOL` case we had before. Now we have a `MKCoordinateRegion` type that needs a conversion function, and we have custom code so that the view will animate when we set the region from JS. Within the function body that we provide, `json` refers to the raw value that has been passed from JS. There is also a `view` variable which gives us access to the manager's view instance, and a `defaultView` that we use to reset the property back to the default value if JS sends us a null sentinel.
+
+You could write any conversion function you want for your view - here is the implementation for `MKCoordinateRegion` via a category on `RCTConvert`. It uses an already existing category of ReactNative `RCTConvert+CoreLocation`:
+
+```objectivec title='RNTMapManager.m'
+#import "RCTConvert+Mapkit.h"
+```
+
+```objectivec title='RCTConvert+Mapkit.h'
+#import
+#import
+#import
+#import
+
+@interface RCTConvert (Mapkit)
+
++ (MKCoordinateSpan)MKCoordinateSpan:(id)json;
++ (MKCoordinateRegion)MKCoordinateRegion:(id)json;
+
+@end
+
+@implementation RCTConvert(MapKit)
+
++ (MKCoordinateSpan)MKCoordinateSpan:(id)json
+{
+ json = [self NSDictionary:json];
+ return (MKCoordinateSpan){
+ [self CLLocationDegrees:json[@"latitudeDelta"]],
+ [self CLLocationDegrees:json[@"longitudeDelta"]]
+ };
+}
+
++ (MKCoordinateRegion)MKCoordinateRegion:(id)json
+{
+ return (MKCoordinateRegion){
+ [self CLLocationCoordinate2D:json],
+ [self MKCoordinateSpan:json]
+ };
+}
+
+@end
+```
+
+These conversion functions are designed to safely process any JSON that the JS might throw at them by displaying "RedBox" errors and returning standard initialization values when missing keys or other developer errors are encountered.
+
+To finish up support for the `region` prop, we need to document it in `propTypes`:
+
+```jsx title='MapView.js'
+MapView.propTypes = {
+ /**
+ * A Boolean value that determines whether the user may use pinch
+ * gestures to zoom in and out of the map.
+ */
+ zoomEnabled: PropTypes.bool,
+
+ /**
+ * The region to be displayed by the map.
+ *
+ * The region is defined by the center coordinates and the span of
+ * coordinates to display.
+ */
+ region: PropTypes.shape({
+ /**
+ * Coordinates for the center of the map.
+ */
+ latitude: PropTypes.number.isRequired,
+ longitude: PropTypes.number.isRequired,
+
+ /**
+ * Distance between the minimum and the maximum latitude/longitude
+ * to be displayed.
+ */
+ latitudeDelta: PropTypes.number.isRequired,
+ longitudeDelta: PropTypes.number.isRequired
+ })
+};
+```
+
+```jsx title='MyApp.js'
+render() {
+ var region = {
+ latitude: 37.48,
+ longitude: -122.16,
+ latitudeDelta: 0.1,
+ longitudeDelta: 0.1,
+ };
+ return (
+
+ );
+}
+```
+
+Here you can see that the shape of the region is explicit in the JS documentation.
+
+## Events
+
+So now we have a native map component that we can control freely from JS, but how do we deal with events from the user, like pinch-zooms or panning to change the visible region?
+
+Until now we've only returned a `MKMapView` instance from our manager's `-(UIView *)view` method. We can't add new properties to `MKMapView` so we have to create a new subclass from `MKMapView` which we use for our View. We can then add a `onRegionChange` callback on this subclass:
+
+```objectivec title='RNTMapView.h'
+#import
+
+#import
+
+@interface RNTMapView: MKMapView
+
+@property (nonatomic, copy) RCTBubblingEventBlock onRegionChange;
+
+@end
+```
+
+```objectivec title='RNTMapView.m'
+#import "RNTMapView.h"
+
+@implementation RNTMapView
+
+@end
+```
+
+Note that all `RCTBubblingEventBlock` must be prefixed with `on`. Next, declare an event handler property on `RNTMapManager`, make it a delegate for all the views it exposes, and forward events to JS by calling the event handler block from the native view.
+
+```objectivec {9,17,31-48} title='RNTMapManager.m'
+#import
+#import
+
+#import "RNTMapView.h"
+#import "RCTConvert+Mapkit.h"
+
+@interface RNTMapManager : RCTViewManager
+@end
+
+@implementation RNTMapManager
+
+RCT_EXPORT_MODULE()
+
+RCT_EXPORT_VIEW_PROPERTY(zoomEnabled, BOOL)
+RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTBubblingEventBlock)
+
+RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, MKMapView)
+{
+ [view setRegion:json ? [RCTConvert MKCoordinateRegion:json] : defaultView.region animated:YES];
+}
+
+- (UIView *)view
+{
+ RNTMapView *map = [RNTMapView new];
+ map.delegate = self;
+ return map;
+}
+
+#pragma mark MKMapViewDelegate
+
+- (void)mapView:(RNTMapView *)mapView regionDidChangeAnimated:(BOOL)animated
+{
+ if (!mapView.onRegionChange) {
+ return;
+ }
+
+ MKCoordinateRegion region = mapView.region;
+ mapView.onRegionChange(@{
+ @"region": @{
+ @"latitude": @(region.center.latitude),
+ @"longitude": @(region.center.longitude),
+ @"latitudeDelta": @(region.span.latitudeDelta),
+ @"longitudeDelta": @(region.span.longitudeDelta),
+ }
+ });
+}
+@end
+```
+
+In the delegate method `-mapView:regionDidChangeAnimated:` the event handler block is called on the corresponding view with the region data. Calling the `onRegionChange` event handler block results in calling the same callback prop in JavaScript. This callback is invoked with the raw event, which we typically process in the wrapper component to simplify the API:
+
+```jsx title='MapView.js'
+class MapView extends React.Component {
+ _onRegionChange = (event) => {
+ if (!this.props.onRegionChange) {
+ return;
+ }
+
+ // process raw event...
+ this.props.onRegionChange(event.nativeEvent);
+ };
+ render() {
+ return (
+
+ );
+ }
+}
+MapView.propTypes = {
+ /**
+ * Callback that is called continuously when the user is dragging the map.
+ */
+ onRegionChange: PropTypes.func,
+ ...
+};
+```
+
+```jsx title='MyApp.js'
+class MyApp extends React.Component {
+ onRegionChange(event) {
+ // Do stuff with event.region.latitude, etc.
+ }
+
+ render() {
+ var region = {
+ latitude: 37.48,
+ longitude: -122.16,
+ latitudeDelta: 0.1,
+ longitudeDelta: 0.1
+ };
+ return (
+
+ );
+ }
+}
+```
+
+## Handling multiple native views
+
+A React Native view can have more than one child view in the view tree eg.
+
+```jsx
+
+
+
+
+
+```
+
+In this example, the class `MyNativeView` is a wrapper for a `NativeComponent` and exposes methods, which will be called on the iOS platform. `MyNativeView` is defined in `MyNativeView.ios.js` and contains proxy methods of `NativeComponent`.
+
+When the user interacts with the component, like clicking the button, the `backgroundColor` of `MyNativeView` changes. In this case `UIManager` would not know which `MyNativeView` should be handled and which one should change `backgroundColor`. Below you will find a solution to this problem:
+
+```jsx
+
+
+
+ {
+ this.myNativeReference.callNativeMethod();
+ }}
+ />
+
+```
+
+Now the above component has a reference to a particular `MyNativeView` which allows us to use a specific instance of `MyNativeView`. Now the button can control which `MyNativeView` should change its `backgroundColor`. In this example let's assume that `callNativeMethod` changes `backgroundColor`.
+
+```jsx title='MyNativeView.ios.js'
+class MyNativeView extends React.Component {
+ callNativeMethod = () => {
+ UIManager.dispatchViewManagerCommand(
+ ReactNative.findNodeHandle(this),
+ UIManager.getViewManagerConfig('RNCMyNativeView').Commands
+ .callNativeMethod,
+ []
+ );
+ };
+
+ render() {
+ return ;
+ }
+}
+```
+
+`callNativeMethod` is our custom iOS method which for example changes the `backgroundColor` which is exposed through `MyNativeView`. This method uses `UIManager.dispatchViewManagerCommand` which needs 3 parameters:
+
+- `(nonnull NSNumber \*)reactTag` - id of react view.
+- `commandID:(NSInteger)commandID` - Id of the native method that should be called
+- `commandArgs:(NSArray \*)commandArgs` - Args of the native method that we can pass from JS to native.
+
+```objectivec title='RNCMyNativeViewManager.m'
+#import
+#import
+#import
+
+RCT_EXPORT_METHOD(callNativeMethod:(nonnull NSNumber*) reactTag) {
+ [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary *viewRegistry) {
+ NativeView *view = viewRegistry[reactTag];
+ if (!view || ![view isKindOfClass:[NativeView class]]) {
+ RCTLogError(@"Cannot find NativeView with tag #%@", reactTag);
+ return;
+ }
+ [view callNativeMethod];
+ }];
+
+}
+```
+
+Here the `callNativeMethod` is defined in the `RNCMyNativeViewManager.m` file and contains only one parameter which is `(nonnull NSNumber*) reactTag`. This exported function will find a particular view using `addUIBlock` which contains the `viewRegistry` parameter and returns the component based on `reactTag` allowing it to call the method on the correct component.
+
+## Styles
+
+Since all our native react views are subclasses of `UIView`, most style attributes will work like you would expect out of the box. Some components will want a default style, however, for example `UIDatePicker` which is a fixed size. This default style is important for the layout algorithm to work as expected, but we also want to be able to override the default style when using the component. `DatePickerIOS` does this by wrapping the native component in an extra view, which has flexible styling, and using a fixed style (which is generated with constants passed in from native) on the inner native component:
+
+```jsx title='DatePickerIOS.ios.js'
+import { UIManager } from 'react-native';
+var RCTDatePickerIOSConsts = UIManager.RCTDatePicker.Constants;
+...
+ render: function() {
+ return (
+
+
+
+ );
+ }
+});
+
+var styles = StyleSheet.create({
+ rkDatePickerIOS: {
+ height: RCTDatePickerIOSConsts.ComponentHeight,
+ width: RCTDatePickerIOSConsts.ComponentWidth,
+ },
+});
+```
+
+The `RCTDatePickerIOSConsts` constants are exported from native by grabbing the actual frame of the native component like so:
+
+```objectivec title='RCTDatePickerManager.m'
+- (NSDictionary *)constantsToExport
+{
+ UIDatePicker *dp = [[UIDatePicker alloc] init];
+ [dp layoutIfNeeded];
+
+ return @{
+ @"ComponentHeight": @(CGRectGetHeight(dp.frame)),
+ @"ComponentWidth": @(CGRectGetWidth(dp.frame)),
+ @"DatePickerModes": @{
+ @"time": @(UIDatePickerModeTime),
+ @"date": @(UIDatePickerModeDate),
+ @"datetime": @(UIDatePickerModeDateAndTime),
+ }
+ };
+}
+```
+
+This guide covered many of the aspects of bridging over custom native components, but there is even more you might need to consider, such as custom hooks for inserting and laying out subviews. If you want to go even deeper, check out the [source code](https://github.com/facebook/react-native/blob/master/React/Views) of some of the implemented components.
diff --git a/website/versioned_docs/version-0.70/native-modules-android.md b/website/versioned_docs/version-0.70/native-modules-android.md
new file mode 100644
index 00000000000..df5066d7e2c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/native-modules-android.md
@@ -0,0 +1,1150 @@
+---
+id: native-modules-android
+title: Android Native Modules
+---
+
+import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+
+
+Welcome to Native Modules for Android. Please start by reading the [Native Modules Intro](native-modules-intro) for an intro to what native modules are.
+
+## Create a Calendar Native Module
+
+In the following guide you will create a native module, `CalendarModule`, that will allow you to access Android’s calendar APIs from JavaScript. By the end, you will be able to call `CalendarModule.createCalendarEvent('Dinner Party', 'My House');` from JavaScript, invoking a Java/Kotlin method that creates a calendar event.
+
+> The React Native team is currently working on a re-architecture of the Native Module system. This new system is called TurboModules, and it will help facilitate more efficient type-safe communication between JavaScript and native, without relying on the React Native bridge. It will also enable new extensions that weren't possible with the legacy Native Module system. You can read more about it [here](https://github.com/react-native-community/discussions-and-proposals/issues/40). Throughout these docs we have added notes around parts of Native Modules that will change in the TurboModules release and how you can best prepare for a smooth upgrade to TurboModules.
+
+### Setup
+
+To get started, open up the Android project within your React Native application in Android Studio. You can find your Android project here within a React Native app:
+
+
+
+ Image of where you can find your Android project
+
+
+We recommend using Android Studio to write your native code. Android studio is an IDE built for Android development and using it will help you resolve minor issues like code syntax errors quickly.
+
+We also recommend enabling [Gradle Daemon](https://docs.gradle.org/2.9/userguide/gradle_daemon.html) to speed up builds as you iterate on Java/Kotlin code.
+
+### Create A Custom Native Module File
+
+The first step is to create the (`CalendarModule.java` or `CalendarModule.kt`) Java/Kotlin file inside `android/app/src/main/java/com/your-app-name/` folder (the folder is the same for both for either Kotlin of Java). This Java/Kotlin file will contain your native module Java/Kotlin class.
+
+
+
+ Image of how to add the CalendarModuleClass
+
+
+Then add the following content:
+
+
+
+
+```java
+package com.your-app-name; // replace com.your-app-name with your app’s name
+import com.facebook.react.bridge.NativeModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactContext;
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
+import com.facebook.react.bridge.ReactMethod;
+import java.util.Map;
+import java.util.HashMap;
+
+public class CalendarModule extends ReactContextBaseJavaModule {
+ CalendarModule(ReactApplicationContext context) {
+ super(context);
+ }
+}
+```
+
+
+
+
+```kotlin
+package com.your-app-name // replace com.your-app-name with your app’s name
+import com.facebook.react.bridge.NativeModule
+import com.facebook.react.bridge.ReactApplicationContext
+import com.facebook.react.bridge.ReactContext
+import com.facebook.react.bridge.ReactContextBaseJavaModule
+import com.facebook.react.bridge.ReactMethod
+
+class CalendarModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {...}
+```
+
+
+
+
+As you can see, your `CalendarModule` class extends the `ReactContextBaseJavaModule` class. For Android, Java/Kotlin native modules are written as classes that extend `ReactContextBaseJavaModule` and implement the functionality required by JavaScript.
+
+> It is worth noting that technically Java/Kotlin classes only need to extend the `BaseJavaModule` class or implement the `NativeModule` interface to be considered a Native Module by React Native.
+
+> However we recommend that you use `ReactContextBaseJavaModule`, as shown above. `ReactContextBaseJavaModule` gives access to the `ReactApplicationContext` (RAC), which is useful for Native Modules that need to hook into activity lifecycle methods. Using `ReactContextBaseJavaModule` will also make it easier to make your native module type-safe in the future. For native module type-safety, which is coming in future releases, React Native looks at each native module's JavaScript spec and generates an abstract base class that extends `ReactContextBaseJavaModule`.
+
+### Module Name
+
+All Java/Kotlin native modules in Android need to implement the `getName()` method. This method returns a string, which represents the name of the native module. The native module can then be accessed in JavaScript using its name. For example, in the below code snippet, `getName()` returns `"CalendarModule"`.
+
+
+
+
+```java
+// add to CalendarModule.java
+@Override
+public String getName() {
+ return "CalendarModule";
+}
+```
+
+
+
+
+```kotlin
+// add to CalendarModule.kt
+override fun getName() = "CalendarModule"
+```
+
+
+
+
+The native module can then be accessed in JS like this:
+
+```jsx
+const { CalendarModule } = ReactNative.NativeModules;
+```
+
+### Export a Native Method to JavaScript
+
+Next you will need to add a method to your native module that will create calendar events and can be invoked in JavaScript. All native module methods meant to be invoked from JavaScript must be annotated with `@ReactMethod`.
+
+Set up a method `createCalendarEvent()` for `CalendarModule` that can be invoked in JS through `CalendarModule.createCalendarEvent()`. For now, the method will take in a name and location as strings. Argument type options will be covered shortly.
+
+
+
+
+```java
+@ReactMethod
+public void createCalendarEvent(String name, String location) {
+}
+```
+
+
+
+
+```kotlin
+@ReactMethod fun createCalendarEvent(name: String, location: String) {}
+```
+
+
+
+
+Add a debug log in the method to confirm it has been invoked when you call it from your application. Below is an example of how you can import and use the [Log](https://developer.android.com/reference/android/util/Log) class from the Android util package:
+
+
+
+
+```java
+import android.util.Log;
+
+@ReactMethod
+public void createCalendarEvent(String name, String location) {
+ Log.d("CalendarModule", "Create event called with name: " + name
+ + " and location: " + location);
+}
+```
+
+
+
+
+```kotlin
+import android.util.Log
+
+@ReactMethod
+fun createCalendarEvent(name: String, location: String) {
+ Log.d("CalendarModule", "Create event called with name: $name and location: $location")
+}
+```
+
+
+
+
+Once you finish implementing the native module and hook it up in JavaScript, you can follow [these steps](https://developer.android.com/studio/debug/am-logcat.html) to view the logs from your app.
+
+### Synchronous Methods
+
+You can pass `isBlockingSynchronousMethod = true` to a native method to mark it as a synchronous method.
+
+
+
+
+```java
+@ReactMethod(isBlockingSynchronousMethod = true)
+```
+
+
+
+
+```kotlin
+@ReactMethod(isBlockingSynchronousMethod = true)
+```
+
+
+
+
+At the moment, we do not recommend this, since calling methods synchronously can have strong performance penalties and introduce threading-related bugs to your native modules. Additionally, please note that if you choose to enable `isBlockingSynchronousMethod`, your app can no longer use the Google Chrome debugger. This is because synchronous methods require the JS VM to share memory with the app. For the Google Chrome debugger, React Native runs inside the JS VM in Google Chrome, and communicates asynchronously with the mobile devices via WebSockets.
+
+### Register the Module (Android Specific)
+
+Once a native module is written, it needs to be registered with React Native. In order to do so, you need to add your native module to a `ReactPackage` and register the `ReactPackage` with React Native. During initialization, React Native will loop over all packages, and for each `ReactPackage`, register each native module within.
+
+React Native invokes the method `createNativeModules()` on a `ReactPackage` in order to get the list of native modules to register. For Android, if a module is not instantiated and returned in createNativeModules it will not be available from JavaScript.
+
+To add your Native Module to `ReactPackage`, first create a new Java/Kotlin Class named (`MyAppPackage.java` or `MyAppPackage.kt`) that implements `ReactPackage` inside the `android/app/src/main/java/com/your-app-name/` folder:
+
+Then add the following content:
+
+
+
+
+```java
+package com.your-app-name; // replace your-app-name with your app’s name
+import com.facebook.react.ReactPackage;
+import com.facebook.react.bridge.NativeModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.uimanager.ViewManager;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class MyAppPackage implements ReactPackage {
+
+ @Override
+ public List createViewManagers(ReactApplicationContext reactContext) {
+ return Collections.emptyList();
+ }
+
+ @Override
+ public List createNativeModules(
+ ReactApplicationContext reactContext) {
+ List modules = new ArrayList<>();
+
+ modules.add(new CalendarModule(reactContext));
+
+ return modules;
+ }
+
+}
+```
+
+
+
+
+```kotlin
+package com.your-app-name // replace your-app-name with your app’s name
+
+import android.view.View
+import com.facebook.react.ReactPackage
+import com.facebook.react.bridge.NativeModule
+import com.facebook.react.bridge.ReactApplicationContext
+import com.facebook.react.uimanager.ReactShadowNode
+import com.facebook.react.uimanager.ViewManager
+
+class MyAppPackage : ReactPackage {
+
+ override fun createViewManagers(
+ reactContext: ReactApplicationContext
+ ): MutableList>> = mutableListOf()
+
+ override fun createNativeModules(
+ reactContext: ReactApplicationContext
+ ): MutableList = listOf(CalendarModule(reactContext)).toMutableList()
+}
+```
+
+
+
+
+This file imports the native module you created, `CalendarModule`. It then instantiates `CalendarModule` within the `createNativeModules()` function and returns it as a list of `NativeModules` to register. If you add more native modules down the line, you can also instantiate them and add them to the list returned here.
+
+> It is worth noting that this way of registering native modules eagerly initializes all native modules when the application starts, which adds to the startup time of an application. You can use [TurboReactPackage](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/TurboReactPackage.java) as an alternative. Instead of `createNativeModules`, which return a list of instantiated native module objects, TurboReactPackage implements a `getModule(String name, ReactApplicationContext rac)` method that creates the native module object, when required. TurboReactPackage is a bit more complicated to implement at the moment. In addition to implementing a `getModule()` method, you have to implement a `getReactModuleInfoProvider()` method, which returns a list of all the native modules the package can instantiate along with a function that instantiates them, example [here](https://github.com/facebook/react-native/blob/8ac467c51b94c82d81930b4802b2978c85539925/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java#L86-L165). Again, using TurboReactPackage will allow your application to have a faster startup time, but it is currently a bit cumbersome to write. So proceed with caution if you choose to use TurboReactPackages.
+
+To register the `CalendarModule` package, you must add `MyAppPackage` to the list of packages returned in ReactNativeHost's `getPackages()` method. Open up your `MainApplication.java` or `MainApplication.kt` file, which can be found in the following path: `android/app/src/main/java/com/your-app-name/`.
+
+Locate ReactNativeHost’s `getPackages()` method and add your package to the packages list `getPackages()` returns:
+
+
+
+
+```java
+@Override
+ protected List getPackages() {
+ @SuppressWarnings("UnnecessaryLocalVariable")
+ List packages = new PackageList(this).getPackages();
+ // below MyAppPackage is added to the list of packages returned
+ packages.add(new MyAppPackage());
+ return packages;
+ }
+```
+
+
+
+
+```kotlin
+override fun getPackages(): List =
+ PackageList(this).packages.apply {
+ // Packages that cannot be autolinked yet can be added manually here, for example:
+ // packages.add(new MyReactNativePackage());
+ add(MyAppPackage())
+ }
+```
+
+
+
+
+You have now successfully registered your native module for Android!
+
+### Test What You Have Built
+
+At this point, you have set up the basic scaffolding for your native module in Android. Test that out by accessing the native module and invoking its exported method in JavaScript.
+
+Find a place in your application where you would like to add a call to the native module’s `createCalendarEvent()` method. Below is an example of a component, `NewModuleButton` you can add in your app. You can invoke the native module inside `NewModuleButton`'s `onPress()` function.
+
+```jsx
+import React from 'react';
+import { NativeModules, Button } from 'react-native';
+
+const NewModuleButton = () => {
+ const onPress = () => {
+ console.log('We will invoke the native module here!');
+ };
+
+ return (
+
+ );
+};
+
+export default NewModuleButton;
+```
+
+In order to access your native module from JavaScript you need to first import `NativeModules` from React Native:
+
+```jsx
+import { NativeModules } from 'react-native';
+```
+
+You can then access the `CalendarModule` native module off of `NativeModules`.
+
+```jsx
+const { CalendarModule } = NativeModules;
+```
+
+Now that you have the CalendarModule native module available, you can invoke your native method `createCalendarEvent()`. Below it is added to the `onPress()` method in `NewModuleButton`:
+
+```jsx
+const onPress = () => {
+ CalendarModule.createCalendarEvent('testName', 'testLocation');
+};
+```
+
+The final step is to rebuild the React Native app so that you can have the latest native code (with your new native module!) available. In your command line, where the react native application is located, run the following:
+
+```shell
+npx react-native run-android
+```
+
+### Building as You Iterate
+
+As you work through these guides and iterate on your native module, you will need to do a native rebuild of your application to access your most recent changes from JavaScript. This is because the code that you are writing sits within the native part of your application. While React Native’s metro bundler can watch for changes in JavaScript and rebuild on the fly for you, it will not do so for native code. So if you want to test your latest native changes you need to rebuild by using the `npx react-native run-android` command.
+
+### Recap✨
+
+You should now be able to invoke your `createCalendarEvent()` method on your native module in the app. In our example this occurs by pressing the `NewModuleButton`. You can confirm this by viewing the log you set up in your `createCalendarEvent()` method. You can follow [these steps](https://developer.android.com/studio/debug/am-logcat.html) to view ADB logs in your app. You should then be able to search for your `Log.d` message (in our example “Create event called with name: testName and location: testLocation”) and see your message logged each time you invoke your native module method.
+
+
+
+ Image of ADB logs in Android Studio
+
+
+At this point you have created an Android native module and invoked its native method from JavaScript in your React Native application. You can read on to learn more about things like argument types available to a native module method and how to setup callbacks and promises.
+
+## Beyond a Calendar Native Module
+
+### Better Native Module Export
+
+Importing your native module by pulling it off of `NativeModules` like above is a bit clunky.
+
+To save consumers of your native module from needing to do that each time they want to access your native module, you can create a JavaScript wrapper for the module. Create a new JavaScript file named `CalendarModule.js` with the following content:
+
+```jsx
+/**
+* This exposes the native CalendarModule module as a JS module. This has a
+* function 'createCalendarEvent' which takes the following parameters:
+
+* 1. String name: A string representing the name of the event
+* 2. String location: A string representing the location of the event
+*/
+import { NativeModules } from 'react-native';
+const { CalendarModule } = NativeModules;
+export default CalendarModule;
+```
+
+This JavaScript file also becomes a good location for you to add any JavaScript side functionality. For example, if you use a type system like TypeScript you can add type annotations for your native module here. While React Native does not yet support Native to JS type safety, all your JS code will be type safe. Doing so will also make it easier for you to switch to type-safe native modules down the line. Below is an example of adding type safety to the CalendarModule:
+
+```jsx
+/**
+* This exposes the native CalendarModule module as a JS module. This has a
+* function 'createCalendarEvent' which takes the following parameters:
+*
+* 1. String name: A string representing the name of the event
+* 2. String location: A string representing the location of the event
+*/
+import { NativeModules } from 'react-native';
+const { CalendarModule } = NativeModules;
+interface CalendarInterface {
+ createCalendarEvent(name: string, location: string): void;
+}
+export default CalendarModule as CalendarInterface;
+```
+
+In your other JavaScript files you can access the native module and invoke its method like this:
+
+```jsx
+import CalendarModule from './CalendarModule';
+CalendarModule.createCalendarEvent('foo', 'bar');
+```
+
+> This assumes that the place you are importing `CalendarModule` is in the same hierarchy as `CalendarModule.js`. Please update the relative import as necessary.
+
+### Argument Types
+
+When a native module method is invoked in JavaScript, React Native converts the arguments from JS objects to their Java/Kotlin object analogues. So for example, if your Java Native Module method accepts a double, in JS you need to call the method with a number. React Native will handle the conversion for you. Below is a list of the argument types supported for native module methods and the JavaScript equivalents they map to.
+
+| Java | Kotlin | JavaScript |
+| ------------- | ------------- | ---------- |
+| Boolean | Boolean | ?boolean |
+| boolean | | boolean |
+| Double | Double | ?number |
+| double | | number |
+| String | String | string |
+| Callback | Callback | Function |
+| ReadableMap | ReadableMap | Object |
+| ReadableArray | ReadableArray | Array |
+
+> The following types are currently supported but will not be supported in TurboModules. Please avoid using them:
+>
+> - Integer Java/Kotlin -> ?number
+> - Float Java/Kotlin -> ?number
+> - int Java -> number
+> - float Java -> number
+
+For argument types not listed above, you will need to handle the conversion yourself. For example, in Android, `Date` conversion is not supported out of the box. You can handle the conversion to the `Date` type within the native method yourself like so:
+
+
+
+
+```java
+ String dateFormat = "yyyy-MM-dd";
+ SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
+ Calendar eStartDate = Calendar.getInstance();
+ try {
+ eStartDate.setTime(sdf.parse(startDate));
+ }
+
+```
+
+
+
+
+```kotlin
+ val dateFormat = "yyyy-MM-dd"
+ val sdf = SimpleDateFormat(dateFormat, Locale.US)
+ val eStartDate = Calendar.getInstance()
+ try {
+ sdf.parse(startDate)?.let {
+ eStartDate.time = it
+ }
+ }
+```
+
+
+
+
+### Exporting Constants
+
+A native module can export constants by implementing the native method `getConstants()`, which is available in JS. Below you will implement `getConstants()` and return a Map that contains a `DEFAULT_EVENT_NAME` constant you can access in JavaScript:
+
+
+
+
+```java
+@Override
+public Map getConstants() {
+ final Map constants = new HashMap<>();
+ constants.put("DEFAULT_EVENT_NAME", "New Event");
+ return constants;
+}
+```
+
+
+
+
+```kotlin
+override fun getConstants(): MutableMap =
+ hashMapOf("DEFAULT_EVENT_NAME" to "New Event")
+```
+
+
+
+
+The constant can then be accessed by invoking `getConstants` on the native module in JS:
+
+```jsx
+const { DEFAULT_EVENT_NAME } = CalendarModule.getConstants();
+console.log(DEFAULT_EVENT_NAME);
+```
+
+Technically it is possible to access constants exported in `getConstants()` directly off the native module object. This will no longer be supported with TurboModules, so we encourage the community to switch to the above approach to avoid necessary migration down the line.
+
+> That currently constants are exported only at initialization time, so if you change getConstants values at runtime it won't affect the JavaScript environment. This will change with Turbomodules. With Turbomodules, `getConstants()` will become a regular native module method, and each invocation will hit the native side.
+
+### Callbacks
+
+Native modules also support a unique kind of argument: a callback. Callbacks are used to pass data from Java/Kotlin to JavaScript for asynchronous methods. They can also be used to asynchronously execute JavaScript from the native side.
+
+In order to create a native module method with a callback, first import the `Callback` interface, and then add a new parameter to your native module method of type `Callback`. There are a couple of nuances with callback arguments that will soon be lifted with TurboModules. First off, you can only have two callbacks in your function arguments- a successCallback and a failureCallback. In addition, the last argument to a native module method call, if it's a function, is treated as the successCallback, and the second to last argument to a native module method call, if it's a function, is treated as the failure callback.
+
+
+
+
+```java
+import com.facebook.react.bridge.Callback;
+
+@ReactMethod
+public void createCalendarEvent(String name, String location, Callback callBack) {
+}
+```
+
+
+
+
+```kotlin
+import com.facebook.react.bridge.Callback
+
+@ReactMethod fun createCalendarEvent(name: String, location: String, callback: Callback) {}
+```
+
+
+
+
+You can invoke the callback in your Java/Kotlin method, providing whatever data you want to pass to JavaScript. Please note that you can only pass serializable data from native code to JavaScript. If you need to pass back a native object you can use `WriteableMaps`, if you need to use a collection use `WritableArrays`. It is also important to highlight that the callback is not invoked immediately after the native function completes. Below the ID of an event created in an earlier call is passed to the callback.
+
+
+
+
+```java
+ @ReactMethod
+ public void createCalendarEvent(String name, String location, Callback callBack) {
+ Integer eventId = ...
+ callBack.invoke(eventId);
+ }
+```
+
+
+
+
+```kotlin
+ @ReactMethod
+ fun createCalendarEvent(name: String, location: String, callback: Callback) {
+ val eventId = ...
+ callback.invoke(eventId)
+ }
+```
+
+
+
+
+This method could then be accessed in JavaScript using:
+
+```jsx
+const onPress = () => {
+ CalendarModule.createCalendarEvent(
+ 'Party',
+ 'My House',
+ (eventId) => {
+ console.log(`Created a new event with id ${eventId}`);
+ }
+ );
+};
+```
+
+Another important detail to note is that a native module method can only invoke one callback, one time. This means that you can either call a success callback or a failure callback, but not both, and each callback can only be invoked at most one time. A native module can, however, store the callback and invoke it later.
+
+There are two approaches to error handling with callbacks. The first is to follow Node’s convention and treat the first argument passed to the callback as an error object.
+
+
+
+
+```java
+ @ReactMethod
+ public void createCalendarEvent(String name, String location, Callback callBack) {
+ Integer eventId = ...
+ callBack.invoke(null, eventId);
+ }
+```
+
+
+
+
+```kotlin
+ @ReactMethod
+ fun createCalendarEvent(name: String, location: String, callback: Callback) {
+ val eventId = ...
+ callback.invoke(null, eventId)
+ }
+```
+
+
+
+
+In JavaScript, you can then check the first argument to see if an error was passed through:
+
+```jsx
+const onPress = () => {
+ CalendarModule.createCalendarEventCallback(
+ 'testName',
+ 'testLocation',
+ (error, eventId) => {
+ if (error) {
+ console.error(`Error found! ${error}`);
+ }
+ console.log(`event id ${eventId} returned`);
+ }
+ );
+};
+```
+
+Another option is to use an onSuccess and onFailure callback:
+
+
+
+
+```java
+@ReactMethod
+public void createCalendarEvent(String name, String location, Callback myFailureCallback, Callback mySuccessCallback) {
+}
+```
+
+
+
+
+```kotlin
+@ReactMethod
+ fun createCalendarEvent(
+ name: String,
+ location: String,
+ myFailureCallback: Callback,
+ mySuccessCallback: Callback
+ ) {}
+```
+
+
+
+
+Then in JavaScript you can add a separate callback for error and success responses:
+
+```jsx
+const onPress = () => {
+ CalendarModule.createCalendarEventCallback(
+ 'testName',
+ 'testLocation',
+ (error) => {
+ console.error(`Error found! ${error}`);
+ },
+ (eventId) => {
+ console.log(`event id ${eventId} returned`);
+ }
+ );
+};
+```
+
+### Promises
+
+Native modules can also fulfill a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise), which can simplify your JavaScript, especially when using ES2016's [async/await](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) syntax. When the last parameter of a native module Java/Kotlin method is a Promise, its corresponding JS method will return a JS Promise object.
+
+Refactoring the above code to use a promise instead of callbacks looks like this:
+
+
+
+
+```java
+import com.facebook.react.bridge.Promise;
+
+@ReactMethod
+public void createCalendarEvent(String name, String location, Promise promise) {
+ try {
+ Integer eventId = ...
+ promise.resolve(eventId);
+ } catch(Exception e) {
+ promise.reject("Create Event Error", e);
+ }
+}
+```
+
+
+
+
+```kotlin
+@ReactMethod
+fun createCalendarEvent(name: String, location: String, promise: Promise) {
+ try {
+ val eventId = ...
+ promise.resolve(eventId)
+ } catch (e: Throwable) {
+ promise.reject("Create Event Error", e)
+ }
+}
+```
+
+
+
+
+> Similar to callbacks, a native module method can either reject or resolve a promise (but not both) and can do so at most once. This means that you can either call a success callback or a failure callback, but not both, and each callback can only be invoked at most one time. A native module can, however, store the callback and invoke it later.
+
+The JavaScript counterpart of this method returns a Promise. This means you can use the `await` keyword within an async function to call it and wait for its result:
+
+```jsx
+const onSubmit = async () => {
+ try {
+ const eventId = await CalendarModule.createCalendarEvent(
+ 'Party',
+ 'My House'
+ );
+ console.log(`Created a new event with id ${eventId}`);
+ } catch (e) {
+ console.error(e);
+ }
+};
+```
+
+The reject method takes different combinations of the following arguments:
+
+
+
+
+```java
+String code, String message, WritableMap userInfo, Throwable throwable
+```
+
+
+
+
+```kotlin
+code: String, message: String, userInfo: WritableMap, throwable: Throwable
+```
+
+
+
+
+For more detail, you can find the `Promise.java` interface [here](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/bridge/Promise.java#L1). If `userInfo` is not provided, ReactNative will set it to null. For the rest of the parameters React Native will use a default value. The `message` argument provides the error `message` shown at the top of an error call stack. Below is an example of the error message shown in JavaScript from the following reject call in Java/Kotlin.
+
+Java/Kotlin reject call:
+
+
+
+
+```java
+promise.reject("Create Event error", "Error parsing date", e);
+```
+
+
+
+
+```kotlin
+promise.reject("Create Event error", "Error parsing date", e)
+```
+
+
+
+
+Error message in React Native App when promise is rejected:
+
+
+
+ Image of error message
+
+
+### Sending Events to JavaScript
+
+Native modules can signal events to JavaScript without being invoked directly. For example, you might want to signal to JavaScript a reminder that a calendar event from the native Android calendar app will occur soon. The easiest way to do this is to use the `RCTDeviceEventEmitter` which can be obtained from the `ReactContext` as in the code snippet below.
+
+
+
+
+```java
+...
+import com.facebook.react.modules.core.DeviceEventManagerModule;
+import com.facebook.react.bridge.WritableMap;
+import com.facebook.react.bridge.Arguments;
+...
+private void sendEvent(ReactContext reactContext,
+ String eventName,
+ @Nullable WritableMap params) {
+ reactContext
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
+ .emit(eventName, params);
+}
+@ReactMethod
+public void addListener(String eventName) {
+ // Set up any upstream listeners or background tasks as necessary
+}
+
+@ReactMethod
+public void removeListeners(Integer count) {
+ // Remove upstream listeners, stop unnecessary background tasks
+}
+...
+WritableMap params = Arguments.createMap();
+params.putString("eventProperty", "someValue");
+...
+sendEvent(reactContext, "EventReminder", params);
+```
+
+
+
+
+```kotlin
+...
+import com.facebook.react.bridge.WritableMap
+import com.facebook.react.bridge.Arguments
+import com.facebook.react.modules.core.DeviceEventManagerModule
+...
+
+private fun sendEvent(reactContext: ReactContext, eventName: String, params: WritableMap?) {
+ reactContext
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
+ .emit(eventName, params)
+}
+
+@ReactMethod
+fun addListener(eventName: String) {
+ // Set up any upstream listeners or background tasks as necessary
+}
+
+@ReactMethod
+fun removeListeners(count: Int) {
+ // Remove upstream listeners, stop unnecessary background tasks
+}
+...
+val params = Arguments.createMap().apply {
+ putString("eventProperty", "someValue")
+}
+...
+sendEvent(reactContext, "EventReminder", params)
+```
+
+
+
+
+JavaScript modules can then register to receive events by `addListener` on the [NativeEventEmitter](https://github.com/facebook/react-native/blob/master/Libraries/EventEmitter/NativeEventEmitter.js) class.
+
+```jsx
+import { NativeEventEmitter, NativeModules } from 'react-native';
+...
+
+ componentDidMount() {
+ ...
+ const eventEmitter = new NativeEventEmitter(NativeModules.ToastExample);
+ this.eventListener = eventEmitter.addListener('EventReminder', (event) => {
+ console.log(event.eventProperty) // "someValue"
+ });
+ ...
+ }
+
+ componentWillUnmount() {
+ this.eventListener.remove(); //Removes the listener
+ }
+```
+
+### Getting Activity Result from startActivityForResult
+
+You'll need to listen to `onActivityResult` if you want to get results from an activity you started with `startActivityForResult`. To do this, you must extend `BaseActivityEventListener` or implement `ActivityEventListener`. The former is preferred as it is more resilient to API changes. Then, you need to register the listener in the module's constructor like so:
+
+
+
+
+```java
+reactContext.addActivityEventListener(mActivityResultListener);
+```
+
+
+
+
+```kotlin
+reactContext.addActivityEventListener(mActivityResultListener);
+```
+
+
+
+
+Now you can listen to `onActivityResult` by implementing the following method:
+
+
+
+
+```java
+@Override
+public void onActivityResult(
+ final Activity activity,
+ final int requestCode,
+ final int resultCode,
+ final Intent intent) {
+ // Your logic here
+}
+```
+
+
+
+
+```kotlin
+override fun onActivityResult(
+ activity: Activity?,
+ requestCode: Int,
+ resultCode: Int,
+ intent: Intent?
+) {
+ // Your logic here
+}
+```
+
+
+
+
+Let's implement a basic image picker to demonstrate this. The image picker will expose the method `pickImage` to JavaScript, which will return the path of the image when called.
+
+
+
+
+```jsx
+public class ImagePickerModule extends ReactContextBaseJavaModule {
+
+ private static final int IMAGE_PICKER_REQUEST = 1;
+ private static final String E_ACTIVITY_DOES_NOT_EXIST = "E_ACTIVITY_DOES_NOT_EXIST";
+ private static final String E_PICKER_CANCELLED = "E_PICKER_CANCELLED";
+ private static final String E_FAILED_TO_SHOW_PICKER = "E_FAILED_TO_SHOW_PICKER";
+ private static final String E_NO_IMAGE_DATA_FOUND = "E_NO_IMAGE_DATA_FOUND";
+
+ private Promise mPickerPromise;
+
+ private final ActivityEventListener mActivityEventListener = new BaseActivityEventListener() {
+
+ @Override
+ public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent intent) {
+ if (requestCode == IMAGE_PICKER_REQUEST) {
+ if (mPickerPromise != null) {
+ if (resultCode == Activity.RESULT_CANCELED) {
+ mPickerPromise.reject(E_PICKER_CANCELLED, "Image picker was cancelled");
+ } else if (resultCode == Activity.RESULT_OK) {
+ Uri uri = intent.getData();
+
+ if (uri == null) {
+ mPickerPromise.reject(E_NO_IMAGE_DATA_FOUND, "No image data found");
+ } else {
+ mPickerPromise.resolve(uri.toString());
+ }
+ }
+
+ mPickerPromise = null;
+ }
+ }
+ }
+ };
+
+ ImagePickerModule(ReactApplicationContext reactContext) {
+ super(reactContext);
+
+ // Add the listener for `onActivityResult`
+ reactContext.addActivityEventListener(mActivityEventListener);
+ }
+
+ @Override
+ public String getName() {
+ return "ImagePickerModule";
+ }
+
+ @ReactMethod
+ public void pickImage(final Promise promise) {
+ Activity currentActivity = getCurrentActivity();
+
+ if (currentActivity == null) {
+ promise.reject(E_ACTIVITY_DOES_NOT_EXIST, "Activity doesn't exist");
+ return;
+ }
+
+ // Store the promise to resolve/reject when picker returns data
+ mPickerPromise = promise;
+
+ try {
+ final Intent galleryIntent = new Intent(Intent.ACTION_PICK);
+
+ galleryIntent.setType("image/*");
+
+ final Intent chooserIntent = Intent.createChooser(galleryIntent, "Pick an image");
+
+ currentActivity.startActivityForResult(chooserIntent, IMAGE_PICKER_REQUEST);
+ } catch (Exception e) {
+ mPickerPromise.reject(E_FAILED_TO_SHOW_PICKER, e);
+ mPickerPromise = null;
+ }
+ }
+}
+```
+
+
+
+
+```kotlin
+class ImagePickerModule(reactContext: ReactApplicationContext) :
+ ReactContextBaseJavaModule(reactContext) {
+
+ private var pickerPromise: Promise? = null
+
+ private val activityEventListener =
+ object : BaseActivityEventListener() {
+ override fun onActivityResult(
+ activity: Activity?,
+ requestCode: Int,
+ resultCode: Int,
+ intent: Intent?
+ ) {
+ if (requestCode == IMAGE_PICKER_REQUEST) {
+ pickerPromise?.let { promise ->
+ when (resultCode) {
+ Activity.RESULT_CANCELED ->
+ promise.reject(E_PICKER_CANCELLED, "Image picker was cancelled")
+ Activity.RESULT_OK -> {
+ val uri = intent?.data
+
+ uri?.let { promise.resolve(uri.toString()) }
+ ?: promise.reject(E_NO_IMAGE_DATA_FOUND, "No image data found")
+ }
+ }
+
+ pickerPromise = null
+ }
+ }
+ }
+ }
+
+ init {
+ reactContext.addActivityEventListener(activityEventListener)
+ }
+
+ override fun getName() = "ImagePickerModule"
+
+ @ReactMethod
+ fun pickImage(promise: Promise) {
+ val activity = currentActivity
+
+ if (activity == null) {
+ promise.reject(E_ACTIVITY_DOES_NOT_EXIST, "Activity doesn't exist")
+ return
+ }
+
+ pickerPromise = promise
+
+ try {
+ val galleryIntent = Intent(Intent.ACTION_PICK).apply { type = "image\/*" }
+
+ val chooserIntent = Intent.createChooser(galleryIntent, "Pick an image")
+
+ activity.startActivityForResult(chooserIntent, IMAGE_PICKER_REQUEST)
+ } catch (t: Throwable) {
+ pickerPromise?.reject(E_FAILED_TO_SHOW_PICKER, t)
+ pickerPromise = null
+ }
+ }
+
+ companion object {
+ const val IMAGE_PICKER_REQUEST = 1
+ const val E_ACTIVITY_DOES_NOT_EXIST = "E_ACTIVITY_DOES_NOT_EXIST"
+ const val E_PICKER_CANCELLED = "E_PICKER_CANCELLED"
+ const val E_FAILED_TO_SHOW_PICKER = "E_FAILED_TO_SHOW_PICKER"
+ const val E_NO_IMAGE_DATA_FOUND = "E_NO_IMAGE_DATA_FOUND"
+ }
+}
+```
+
+
+
+
+### Listening to Lifecycle Events
+
+Listening to the activity's LifeCycle events such as `onResume`, `onPause` etc. is very similar to how `ActivityEventListener` was implemented. The module must implement `LifecycleEventListener`. Then, you need to register a listener in the module's constructor like so:
+
+
+
+
+```java
+reactContext.addLifecycleEventListener(this);
+```
+
+
+
+
+```kotlin
+reactContext.addLifecycleEventListener(this)
+```
+
+
+
+
+Now you can listen to the activity's LifeCycle events by implementing the following methods:
+
+
+
+
+```java
+@Override
+public void onHostResume() {
+ // Activity `onResume`
+}
+@Override
+public void onHostPause() {
+ // Activity `onPause`
+}
+@Override
+public void onHostDestroy() {
+ // Activity `onDestroy`
+}
+```
+
+
+
+
+```kotlin
+override fun onHostResume() {
+ // Activity `onResume`
+}
+
+override fun onHostPause() {
+ // Activity `onPause`
+}
+
+override fun onHostDestroy() {
+ // Activity `onDestroy`
+}
+```
+
+
+
+
+### Threading
+
+To date, on Android, all native module async methods execute on one thread. Native modules should not have any assumptions about what thread they are being called on, as the current assignment is subject to change in the future. If a blocking call is required, the heavy work should be dispatched to an internally managed worker thread, and any callbacks distributed from there.
diff --git a/website/versioned_docs/version-0.70/native-modules-intro.md b/website/versioned_docs/version-0.70/native-modules-intro.md
new file mode 100644
index 00000000000..35162726dfa
--- /dev/null
+++ b/website/versioned_docs/version-0.70/native-modules-intro.md
@@ -0,0 +1,29 @@
+---
+id: native-modules-intro
+title: Native Modules Intro
+---
+
+import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
+
+
+
+Sometimes a React Native app needs to access a native platform API that is not available by default in JavaScript, for example the native APIs to access Apple or Google Pay. Maybe you want to reuse some existing Objective-C, Swift, Java or C++ libraries without having to reimplement it in JavaScript, or write some high performance, multi-threaded code for things like image processing.
+
+The NativeModule system exposes instances of Java/Objective-C/C++ (native) classes to JavaScript (JS) as JS objects, thereby allowing you to execute arbitrary native code from within JS. While we don't expect this feature to be part of the usual development process, it is essential that it exists. If React Native doesn't export a native API that your JS app needs you should be able to export it yourself!
+
+## Native Module Setup
+
+There are two ways to write a native module for your React Native application:
+
+1. Directly within your React Native application’s iOS/Android projects
+2. As a NPM package that can be installed as a dependency by your/other React Native applications
+
+This guide will first walk you through implementing a native module directly within a React Native application. However the native module you build in the following guide can be distributed as an NPM package. Check out the [Setting Up a Native Module as a NPM Package](native-modules-setup) guide if you are interested in doing so.
+
+## Getting Started
+
+In the following sections we will walk you through guides on how to build a native module directly within a React Native application. As a prerequisite, you will need a React Native application to work within. You can follow the steps [here](getting-started) to setup a React Native application if you do not already have one.
+
+Imagine that you want to access the iOS/Android native calendar APIs from JavaScript within a React Native application in order to create calendar events. React Native does not expose a JavaScript API to communicate with the native calendar libraries. However, through native modules, you can write native code that communicates with native calendar APIs. Then you can invoke that native code through JavaScript in your React Native application.
+
+In the following sections you will create such a Calendar native module for both [Android](native-modules-android) and [iOS](native-modules-ios).
diff --git a/website/versioned_docs/version-0.70/native-modules-ios.md b/website/versioned_docs/version-0.70/native-modules-ios.md
new file mode 100644
index 00000000000..433acc37cd0
--- /dev/null
+++ b/website/versioned_docs/version-0.70/native-modules-ios.md
@@ -0,0 +1,607 @@
+---
+id: native-modules-ios
+title: iOS Native Modules
+---
+
+import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
+
+
+
+Welcome to Native Modules for iOS. Please start by reading the [Native Modules Intro](native-modules-intro) for an intro to what native modules are.
+
+## Create a Calendar Native Module
+
+In the following guide you will create a native module, `CalendarModule`, that will allow you to access Apple's calendar APIs from JavaScript. By the end you will be able to call `CalendarModule.createCalendarEvent('Dinner Party', 'My House');` from JavaScript, invoking a native method that creates a calendar event.
+
+> The React Native team is currently working on a re-architecture of the Native Module system. This new system is called TurboModules, and it will help facilitate more efficient type-safe communication between JavaScript and native, without relying on the React Native bridge. It will also enable new extensions that weren't possible with the legacy Native Module system. You can read more about it [here](https://github.com/react-native-community/discussions-and-proposals/issues/40). Throughout these docs we have added notes around parts of Native Modules that will change in the TurboModules release and how you can best prepare for a smooth upgrade to TurboModules.
+
+### Setup
+
+To get started, open up the iOS project within your React Native application in Xcode. You can find your iOS project here within a React Native app:
+
+
+
+ Image of where you can find your iOS project
+
+
+We recommend using Xcode to write your native code. Xcode is built for iOS development, and using it will help you to quickly resolve smaller errors like code syntax.
+
+### Create Custom Native Module Files
+
+The first step is to create our main custom native module header and implementation files. Create a new file called `RCTCalendarModule.h`
+
+
+
+ Image of creating a custom native module file within the same folder as AppDelegate
+
+
+and add the following to it:
+
+```objectivec
+// RCTCalendarModule.h
+#import
+@interface RCTCalendarModule : NSObject
+@end
+
+```
+
+You can use any name that fits the native module you are building. Name the class `RCTCalendarModule` since you are creating a calendar native module. Since ObjC does not have language-level support for namespaces like Java or C++, convention is to prepend the class name with a substring. This could be an abbreviation of your application name or your infra name. RCT, in this example, refers to React.
+
+As you can see below, the CalendarModule class implements the `RCTBridgeModule` protocol. A native module is an Objective-C class that implements the `RCTBridgeModule` protocol.
+
+Next up, let’s start implementing the native module. Create the corresponding implementation file, `RCTCalendarModule.m`, in the same folder and include the following content:
+
+```objectivec
+// RCTCalendarModule.m
+#import "RCTCalendarModule.h"
+
+@implementation RCTCalendarModule
+
+// To export a module named RCTCalendarModule
+RCT_EXPORT_MODULE();
+
+@end
+
+```
+
+### Module Name
+
+For now, your `RCTCalendarModule.m` native module only includes a `RCT_EXPORT_MODULE` macro, which exports and registers the native module class with React Native. The `RCT_EXPORT_MODULE` macro also takes an optional argument that specifies the name that the module will be accessible as in your JavaScript code.
+
+This argument is not a string literal. In the example below `RCT_EXPORT_MODULE(CalendarModuleFoo)` is passed, not `RCT_EXPORT_MODULE("CalendarModuleFoo")`.
+
+```objectivec
+// To export a module named CalendarModuleFoo
+RCT_EXPORT_MODULE(CalendarModuleFoo);
+```
+
+The native module can then be accessed in JS like this:
+
+```jsx
+const { CalendarModuleFoo } = ReactNative.NativeModules;
+```
+
+If you do not specify a name, the JavaScript module name will match the Objective-C class name, with any "RCT" or "RK" prefixes removed.
+
+Let's follow the example below and call `RCT_EXPORT_MODULE` without any arguments. As a result, the module will be exposed to React Native using the name `CalendarModule`, since that is the Objective-C class name, with RCT removed.
+
+```objectivec
+// Without passing in a name this will export the native module name as the Objective-C class name with “RCT” removed
+RCT_EXPORT_MODULE();
+```
+
+The native module can then be accessed in JS like this:
+
+```jsx
+const { CalendarModule } = ReactNative.NativeModules;
+```
+
+### Export a Native Method to JavaScript
+
+React Native will not expose any methods in a native module to JavaScript unless explicitly told to. This can be done using the `RCT_EXPORT_METHOD` macro. Methods written in the `RCT_EXPORT_METHOD` macro are asynchronous and the return type is therefore always void. In order to pass a result from a `RCT_EXPORT_METHOD` method to JavaScript you can use callbacks or emit events (covered below). Let’s go ahead and set up a native method for our `CalendarModule` native module using the `RCT_EXPORT_METHOD` macro. Call it `createCalendarEvent()` and for now have it take in name and location arguments as strings. Argument type options will be covered shortly.
+
+```objectivec
+RCT_EXPORT_METHOD(createCalendarEvent:(NSString *)name location:(NSString *)location)
+{
+}
+```
+
+> Please note that the `RCT_EXPORT_METHOD` macro will not be necessary with TurboModules unless your method relies on RCT argument conversion (see argument types below). Ultimately, React Native will remove `RCT_EXPORT_MACRO,` so we discourage people from using `RCTConvert`. Instead, you can do the argument conversion within the method body.
+
+Before you build out the `createCalendarEvent()` method’s functionality, add a console log in the method so you can confirm it has been invoked from JavaScript in your React Native application. Use the `RCTLog` APIs from React. Let’s import that header at the top of your file and then add the log call.
+
+```objectivec
+#import
+RCT_EXPORT_METHOD(createCalendarEvent:(NSString *)name location:(NSString *)location)
+{
+ RCTLogInfo(@"Pretending to create an event %@ at %@", name, location);
+}
+```
+
+### Synchronous Methods
+
+You can use the `RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD` to create a synchronous native method.
+
+```objectivec
+RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getName)
+{
+return [[UIDevice currentDevice] name];
+}
+```
+
+The return type of this method must be of object type (id) and should be serializable to JSON. This means that the hook can only return nil or JSON values (e.g. NSNumber, NSString, NSArray, NSDictionary).
+
+At the moment, we do not recommend using synchronous methods, since calling methods synchronously can have strong performance penalties and introduce threading-related bugs to your native modules. Additionally, please note that if you choose to use `RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD`, your app can no longer use the Google Chrome debugger. This is because synchronous methods require the JS VM to share memory with the app. For the Google Chrome debugger, React Native runs inside the JS VM in Google Chrome, and communicates asynchronously with the mobile devices via WebSockets.
+
+### Test What You Have Built
+
+At this point you have set up the basic scaffolding for your native module in iOS. Test that out by accessing the native module and invoking it’s exported method in JavaScript.
+
+Find a place in your application where you would like to add a call to the native module’s `createCalendarEvent()` method. Below is an example of a component, `NewModuleButton` you can add in your app. You can invoke the native module inside `NewModuleButton`'s `onPress()` function.
+
+```jsx
+import React from 'react';
+import { NativeModules, Button } from 'react-native';
+
+const NewModuleButton = () => {
+ const onPress = () => {
+ console.log('We will invoke the native module here!');
+ };
+
+ return (
+
+ );
+};
+
+export default NewModuleButton;
+```
+
+In order to access your native module from JavaScript you need to first import `NativeModules` from React Native:
+
+```jsx
+import { NativeModules } from 'react-native';
+```
+
+You can then access the `CalendarModule` native module off of `NativeModules`.
+
+```jsx
+const { CalendarModule } = NativeModules;
+```
+
+Now that you have the CalendarModule native module available, you can invoke your native method `createCalendarEvent()`. Below it is added to the `onPress()` method in `NewModuleButton`:
+
+```jsx
+const onPress = () => {
+ CalendarModule.createCalendarEvent('testName', 'testLocation');
+};
+```
+
+The final step is to rebuild the React Native app so that you can have the latest native code (with your new native module!) available. In your command line, where the react native application is located, run the following :
+
+```shell
+npx react-native run-ios
+```
+
+### Building as You Iterate
+
+As you work through these guides and iterate on your native module, you will need to do a native rebuild of your application to access your most recent changes from JavaScript. This is because the code that you are writing sits within the native part of your application. While React Native’s metro bundler can watch for changes in JavaScript and rebuild JS bundle on the fly for you, it will not do so for native code. So if you want to test your latest native changes you need to rebuild by using the `npx react-native run-ios` command.
+
+### Recap✨
+
+You should now be able to invoke your `createCalendarEvent()` method on your native module in JavaScript. Since you are using `RCTLog` in the function, you can confirm your native method is being invoked by [enabling debug mode in your app](https://reactnative.dev/docs/debugging#chrome-developer-tools) and looking at the JS console in Chrome or the mobile app debugger Flipper. You should see your `RCTLogInfo(@"Pretending to create an event %@ at %@", name, location);` message each time you invoke the native module method.
+
+
+
+ Image of iOS logs in Flipper
+
+
+At this point you have created an iOS native module and invoked a method on it from JavaScript in your React Native application. You can read on to learn more about things like what argument types your native module method takes and how to setup callbacks and promises within your native module.
+
+## Beyond a Calendar Native Module
+
+### Better Native Module Export
+
+Importing your native module by pulling it off of `NativeModules` like above is a bit clunky.
+
+To save consumers of your native module from needing to do that each time they want to access your native module, you can create a JavaScript wrapper for the module. Create a new JavaScript file named NativeCalendarModule.js with the following content:
+
+```jsx
+/**
+* This exposes the native CalendarModule module as a JS module. This has a
+* function 'createCalendarEvent' which takes the following parameters:
+
+* 1. String name: A string representing the name of the event
+* 2. String location: A string representing the location of the event
+*/
+import { NativeModules } from 'react-native';
+const { CalendarModule } = NativeModules;
+export default CalendarModule;
+```
+
+This JavaScript file also becomes a good location for you to add any JavaScript side functionality. For example, if you use a type system like TypeScript you can add type annotations for your native module here. While React Native does not yet support Native to JS type safety, with these type annotations, all your JS code will be type safe. These annotations will also make it easier for you to switch to type-safe native modules down the line. Below is an example of adding type safety to the Calendar Module:
+
+```jsx
+/**
+* This exposes the native CalendarModule module as a JS module. This has a
+* function 'createCalendarEvent' which takes the following parameters:
+*
+* 1. String name: A string representing the name of the event
+* 2. String location: A string representing the location of the event
+*/
+import { NativeModules } from 'react-native';
+const { CalendarModule } = NativeModules;
+interface CalendarInterface {
+ createCalendarEvent(name: string, location: string): void;
+}
+export default CalendarModule as CalendarInterface;
+```
+
+In your other JavaScript files you can access the native module and invoke its method like this:
+
+```jsx
+import NativeCalendarModule from './NativeCalendarModule';
+NativeCalendarModule.createCalendarEvent('foo', 'bar');
+```
+
+> Note this assumes that the place you are importing `CalendarModule` is in the same hierarchy as `CalendarModule.js`. Please update the relative import as necessary.
+
+### Argument Types
+
+When a native module method is invoked in JavaScript, React Native converts the arguments from JS objects to their Objective-C/Swift object analogues. So for example, if your Objective-C Native Module method accepts a NSNumber, in JS you need to call the method with a number. React Native will handle the conversion for you. Below is a list of the argument types supported for native module methods and the JavaScript equivalents they map to.
+
+| Objective-C | JavaScript |
+| --------------------------------------------- | ------------------ |
+| NSString | string, ?string |
+| BOOL | boolean |
+| NSNumber | ?boolean |
+| double | number |
+| NSNumber | ?number |
+| NSArray | Array, ?Array |
+| NSDictionary | Object, ?Object |
+| RCTResponseSenderBlock | Function (success) |
+| RCTResponseSenderBlock, RCTResponseErrorBlock | Function (failure) |
+| RCTPromiseResolveBlock, RCTPromiseRejectBlock | Promise |
+
+> The following types are currently supported but will not be supported in TurboModules. Please avoid using them.
+>
+> - Function (failure) -> RCTResponseErrorBlock
+> - Number -> NSInteger
+> - Number -> CGFloat
+> - Number -> float
+
+For iOS, you can also write native module methods with any argument type that is supported by the `RCTConvert` class (see [RCTConvert](https://github.com/facebook/react-native/blob/master/React/Base/RCTConvert.h) for details about what is supported). The RCTConvert helper functions all accept a JSON value as input and map it to a native Objective-C type or class.
+
+### Exporting Constants
+
+A native module can export constants by overriding the native method `constantsToExport()`. Below `constantsToExport()` is overriden, and returns a Dictionary that contains a default event name property you can access in JavaScript like so:
+
+```objectivec
+- (NSDictionary *)constantsToExport
+{
+ return @{ @"DEFAULT_EVENT_NAME": @"New Event" };
+}
+```
+
+The constant can then be accessed by invoking `getConstants()` on the native module in JS like so:
+
+```objectivec
+const { DEFAULT_EVENT_NAME } = CalendarModule.getConstants();
+console.log(DEFAULT_EVENT_NAME);
+```
+
+Technically, it is possible to access constants exported in `constantsToExport()` directly off the `NativeModule` object. This will no longer be supported with TurboModules, so we encourage the community to switch to the above approach to avoid necessary migration down the line.
+
+> Note that the constants are exported only at initialization time, so if you change `constantsToExport()` values at runtime it won't affect the JavaScript environment.
+
+For iOS, if you override `constantsToExport()` then you should also implement `+ requiresMainQueueSetup` to let React Native know if your module needs to be initialized on the main thread, before any JavaScript code executes. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with `+ requiresMainQueueSetup:`. If your module does not require access to UIKit, then you should respond to `+ requiresMainQueueSetup` with NO.
+
+### Callbacks
+
+Native modules also support a unique kind of argument - a callback. Callbacks are used to pass data from Objective-C to JavaScript for asynchronous methods. They can also be used to asynchronously execute JS from the native side.
+
+For iOS, callbacks are implemented using the type `RCTResponseSenderBlock`. Below the callback parameter `myCallBack` is added to the `createCalendarEventMethod()`:
+
+```objectivec
+RCT_EXPORT_METHOD(createCalendarEvent:(NSString *)title
+ location:(NSString *)location
+ myCallback:(RCTResponseSenderBlock)callback)
+
+```
+
+You can then invoke the callback in your native function, providing whatever result you want to pass to JavaScript in an array. Note that `RCTResponseSenderBlock` accepts only one argument - an array of parameters to pass to the JavaScript callback. Below you will pass back the ID of an event created in an earlier call.
+
+> It is important to highlight that the callback is not invoked immediately after the native function completes—remember the communication is asynchronous.
+
+```objectivec
+RCT_EXPORT_METHOD(createCalendarEvent:(NSString *)title location:(NSString *)location callback: (RCTResponseSenderBlock)callback)
+{
+ NSInteger eventId = ...
+ callback(@[@(eventId)]);
+
+ RCTLogInfo(@"Pretending to create an event %@ at %@", title, location);
+}
+
+```
+
+This method could then be accessed in JavaScript using the following:
+
+```jsx
+const onSubmit = () => {
+ CalendarModule.createCalendarEvent(
+ 'Party',
+ '04-12-2020',
+ (eventId) => {
+ console.log(`Created a new event with id ${eventId}`);
+ }
+ );
+};
+```
+
+A native module is supposed to invoke its callback only once. It can, however, store the callback and invoke it later. This pattern is often used to wrap iOS APIs that require delegates— see [`RCTAlertManager`](https://github.com/facebook/react-native/blob/3a11f0536ea65b87dc0f006665f16a87cfa14b5e/React/CoreModules/RCTAlertManager.mm) for an example. If the callback is never invoked, some memory is leaked.
+
+There are two approaches to error handling with callbacks. The first is to follow Node’s convention and treat the first argument passed to the callback array as an error object.
+
+```objectivec
+RCT_EXPORT_METHOD(createCalendarEventCallback:(NSString *)title location:(NSString *)location callback: (RCTResponseSenderBlock)callback)
+{
+ NSNumber *eventId = [NSNumber numberWithInt:123];
+ callback(@[[NSNull null], eventId]);
+}
+```
+
+In JavaScript, you can then check the first argument to see if an error was passed through:
+
+```jsx
+const onPress = () => {
+ CalendarModule.createCalendarEventCallback(
+ 'testName',
+ 'testLocation',
+ (error, eventId) => {
+ if (error) {
+ console.error(`Error found! ${error}`);
+ }
+ console.log(`event id ${eventId} returned`);
+ }
+ );
+};
+```
+
+Another option is to use two separate callbacks: onFailure and onSuccess.
+
+```objectivec
+RCT_EXPORT_METHOD(createCalendarEventCallback:(NSString *)title
+ location:(NSString *)location
+ errorCallback: (RCTResponseSenderBlock)errorCallback
+ successCallback: (RCTResponseSenderBlock)successCallback)
+{
+ @try {
+ NSNumber *eventId = [NSNumber numberWithInt:123];
+ successCallback(@[eventId]);
+ }
+
+ @catch ( NSException *e ) {
+ errorCallback(@[e]);
+ }
+}
+```
+
+Then in JavaScript you can add a separate callback for error and success responses:
+
+```jsx
+const onPress = () => {
+ CalendarModule.createCalendarEventCallback(
+ 'testName',
+ 'testLocation',
+ (error) => {
+ console.error(`Error found! ${error}`);
+ },
+ (eventId) => {
+ console.log(`event id ${eventId} returned`);
+ }
+ );
+};
+```
+
+If you want to pass error-like objects to JavaScript, use `RCTMakeError` from [`RCTUtils.h.`](https://github.com/facebook/react-native/blob/master/React/Base/RCTUtils.h) Right now this only passes an Error-shaped dictionary to JavaScript, but React Native aims to automatically generate real JavaScript Error objects in the future. You can also provide a `RCTResponseErrorBlock` argument, which is used for error callbacks and accepts an `NSError \* object`. Please note that this argument type will not be supported with TurboModules.
+
+### Promises
+
+Native modules can also fulfill a promise, which can simplify your JavaScript, especially when using ES2016's `async/await` syntax. When the last parameter of a native module method is a `RCTPromiseResolveBlock` and `RCTPromiseRejectBlock`, its corresponding JS method will return a JS Promise object.
+
+Refactoring the above code to use a promise instead of callbacks looks like this:
+
+```objectivec
+RCT_EXPORT_METHOD(createCalendarEvent:(NSString *)title
+ location:(NSString *)location
+ resolver:(RCTPromiseResolveBlock)resolve
+ rejecter:(RCTPromiseRejectBlock)reject)
+{
+ NSInteger eventId = createCalendarEvent();
+ if (eventId) {
+ resolve(@(eventId));
+ } else {
+ reject(@"event_failure", @"no event id returned", nil);
+ }
+}
+
+```
+
+The JavaScript counterpart of this method returns a Promise. This means you can use the `await` keyword within an async function to call it and wait for its result:
+
+```jsx
+const onSubmit = async () => {
+ try {
+ const eventId = await CalendarModule.createCalendarEvent(
+ 'Party',
+ 'my house'
+ );
+ console.log(`Created a new event with id ${eventId}`);
+ } catch (e) {
+ console.error(e);
+ }
+};
+```
+
+### Sending Events to JavaScript
+
+Native modules can signal events to JavaScript without being invoked directly. For example, you might want to signal to JavaScript a reminder that a calendar event from the native iOS calendar app will occur soon. The preferred way to do this is to subclass `RCTEventEmitter`, implement `supportedEvents` and call self `sendEventWithName`:
+
+Update your header class to import `RCTEventEmitter` and subclass `RCTEventEmitter`:
+
+```objectivec
+// CalendarModule.h
+
+#import
+#import
+
+@interface CalendarModule : RCTEventEmitter
+@end
+
+```
+
+JavaScript code can subscribe to these events by creating a new `NativeEventEmitter` instance around your module.
+
+You will receive a warning if you expend resources unnecessarily by emitting an event while there are no listeners. To avoid this, and to optimize your module's workload (e.g. by unsubscribing from upstream notifications or pausing background tasks), you can override `startObserving` and `stopObserving` in your `RCTEventEmitter` subclass.
+
+```objectivec
+@implementation CalendarManager
+{
+ bool hasListeners;
+}
+
+// Will be called when this module's first listener is added.
+-(void)startObserving {
+ hasListeners = YES;
+ // Set up any upstream listeners or background tasks as necessary
+}
+
+// Will be called when this module's last listener is removed, or on dealloc.
+-(void)stopObserving {
+ hasListeners = NO;
+ // Remove upstream listeners, stop unnecessary background tasks
+}
+
+- (void)calendarEventReminderReceived:(NSNotification *)notification
+{
+ NSString *eventName = notification.userInfo[@"name"];
+ if (hasListeners) { // Only send events if anyone is listening
+ [self sendEventWithName:@"EventReminder" body:@{@"name": eventName}];
+ }
+}
+
+```
+
+### Threading
+
+Unless the native module provides its own method queue, it shouldn't make any assumptions about what thread it's being called on. Currently, if a native module doesn't provide a method queue, React Native will create a separate GCD queue for it and invoke its methods there. Please note that this is an implementation detail and might change. If you want to explicitly provide a method queue for a native module, override the `(dispatch_queue_t) methodQueue` method in the native module. For example, if it needs to use a main-thread-only iOS API, it should specify this via:
+
+```objectivec
+- (dispatch_queue_t)methodQueue
+{
+ return dispatch_get_main_queue();
+}
+```
+
+Similarly, if an operation may take a long time to complete, the native module can specify its own queue to run operations on. Again, currently React Native will provide a separate method queue for your native module, but this is an implementation detail you should not rely on. If you don't provide your own method queue, in the future, your native module's long running operations may end up blocking async calls being executed on other unrelated native modules. The `RCTAsyncLocalStorage` module here, for example, creates its own queue so the React queue isn't blocked waiting on potentially slow disk access.
+
+```objectivec
+- (dispatch_queue_t)methodQueue
+{
+ return dispatch_queue_create("com.facebook.React.AsyncLocalStorageQueue", DISPATCH_QUEUE_SERIAL);
+}
+```
+
+The specified `methodQueue` will be shared by all of the methods in your module. If only one of your methods is long-running (or needs to be run on a different queue than the others for some reason), you can use `dispatch_async` inside the method to perform that particular method's code on another queue, without affecting the others:
+
+```objectivec
+RCT_EXPORT_METHOD(doSomethingExpensive:(NSString *)param callback:(RCTResponseSenderBlock)callback)
+{
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+ // Call long-running code on background thread
+ ...
+ // You can invoke callback from any thread/queue
+ callback(@[...]);
+ });
+}
+
+```
+
+> Sharing dispatch queues between modules
+>
+> The `methodQueue` method will be called once when the module is initialized, and then retained by React Native, so there is no need to keep a reference to the queue yourself, unless you wish to make use of it within your module. However, if you wish to share the same queue between multiple modules then you will need to ensure that you retain and return the same queue instance for each of them.
+
+### Dependency Injection
+
+React Native will create and initialize any registered native modules automatically. However, you may wish to create and initialize your own module instances to, for example, inject dependencies.
+
+You can do this by creating a class that implements the `RCTBridgeDelegate` Protocol, initializing an `RCTBridge` with the delegate as an argument and initialising a `RCTRootView` with the initialized bridge.
+
+```objectivec
+id moduleInitialiser = [[classThatImplementsRCTBridgeDelegate alloc] init];
+
+RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:moduleInitialiser launchOptions:nil];
+
+RCTRootView *rootView = [[RCTRootView alloc]
+ initWithBridge:bridge
+ moduleName:kModuleName
+ initialProperties:nil];
+```
+
+### Exporting Swift
+
+Swift doesn't have support for macros, so exposing native modules and their methods to JavaScript inside React Native requires a bit more setup. However, it works relatively the same. Let's say you have the same `CalendarModule` but as a Swift class:
+
+```swift
+// CalendarManager.swift
+
+@objc(CalendarManager)
+class CalendarManager: NSObject {
+
+ @objc(addEvent:location:date:)
+ func addEvent(_ name: String, location: String, date: NSNumber) -> Void {
+ // Date is ready to use!
+ }
+
+ @objc
+ func constantsToExport() -> [String: Any]! {
+ return ["someKey": "someValue"]
+ }
+
+}
+```
+
+> It is important to use the `@objc` modifiers to ensure the class and functions are exported properly to the Objective-C runtime.
+
+Then create a private implementation file that will register the required information with React Native:
+
+```objectivec
+// CalendarManagerBridge.m
+#import
+
+@interface RCT_EXTERN_MODULE(CalendarManager, NSObject)
+
+RCT_EXTERN_METHOD(addEvent:(NSString *)name location:(NSString *)location date:(nonnull NSNumber *)date)
+
+@end
+```
+
+For those of you new to Swift and Objective-C, whenever you [mix the two languages in an iOS project](https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html), you will also need an additional bridging file, known as a bridging header, to expose the Objective-C files to Swift. Xcode will offer to create this header file for you if you add your Swift file to your app through the Xcode `File>New File` menu option. You will need to import `RCTBridgeModule.h` in this header file.
+
+```objectivec
+// CalendarManager-Bridging-Header.h
+#import
+```
+
+You can also use `RCT_EXTERN_REMAP_MODULE` and `_RCT_EXTERN_REMAP_METHOD` to alter the JavaScript name of the module or methods you are exporting. For more information see [`RCTBridgeModule`](https://github.com/facebook/react-native/blob/master/React/Base/RCTBridgeModule.h).
+
+> Important when making third party modules: Static libraries with Swift are only supported in Xcode 9 and later. In order for the Xcode project to build when you use Swift in the iOS static library you include in the module, your main app project must contain Swift code and a bridging header itself. If your app project does not contain any Swift code, a workaround can be a single empty .swift file and an empty bridging header.
+
+### Reserved Method Names
+
+#### invalidate()
+
+Native modules can conform to the [RCTInvalidating](https://github.com/facebook/react-native/blob/0.62-stable/React/Base/RCTInvalidating.h) protocol on iOS by implementing the `invalidate()` method. This method [can be invoked](https://github.com/facebook/react-native/blob/0.62-stable/ReactCommon/turbomodule/core/platform/ios/RCTTurboModuleManager.mm#L456) when the native bridge is invalidated (ie: on devmode reload). Please use this mechanism as necessary to do the required cleanup for your native module.
diff --git a/website/versioned_docs/version-0.70/native-modules-setup.md b/website/versioned_docs/version-0.70/native-modules-setup.md
new file mode 100644
index 00000000000..42b877394c0
--- /dev/null
+++ b/website/versioned_docs/version-0.70/native-modules-setup.md
@@ -0,0 +1,35 @@
+---
+id: native-modules-setup
+title: Native Modules NPM Package Setup
+---
+
+import NativeDeprecated from './the-new-architecture/\_markdown_native_deprecation.mdx'
+
+
+
+Native modules are usually distributed as npm packages, except that on top of the usual JavaScript they will include some native code per platform. To understand more about npm packages you may find [this guide](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) useful.
+
+To get set up with the basic project structure for a native module we will use the community tool called [create-react-native-library](https://github.com/callstack/react-native-builder-bob). You can go ahead further and dive deep into how that library works, but for our needs we will only execute the basic script:
+
+```shell
+npx create-react-native-library react-native-awesome-module
+```
+
+Where `react-native-awesome-module` is the name you would like for the new module. After doing this you will navigate into `react-native-awesome-module` folder and bootstrap the example project by running:
+
+```shell
+yarn
+```
+
+When the bootstrap is done, you will be able to start the example app by executing one of the following commands:
+
+```shell
+# Android app
+yarn example android
+# iOS app
+yarn example ios
+```
+
+When all steps above are done, you will be able to continue with [Android Native Modules](native-modules-android) or [iOS Native Modules](native-modules-ios) guides to add in some code.
+
+> For a less opinionated setup, have a look at the third party tool [create-react-native-module](https://github.com/brodybits/create-react-native-module).
diff --git a/website/versioned_docs/version-0.70/navigation.md b/website/versioned_docs/version-0.70/navigation.md
new file mode 100644
index 00000000000..e3a388eae8f
--- /dev/null
+++ b/website/versioned_docs/version-0.70/navigation.md
@@ -0,0 +1,126 @@
+---
+id: navigation
+title: Navigating Between Screens
+---
+
+import M1Cocoapods from './\_markdown-m1-cocoapods.mdx';
+
+Mobile apps are rarely made up of a single screen. Managing the presentation of, and transition between, multiple screens is typically handled by what is known as a navigator.
+
+This guide covers the various navigation components available in React Native. If you are getting started with navigation, you will probably want to use [React Navigation](navigation.md#react-navigation). React Navigation provides a straightforward navigation solution, with the ability to present common stack navigation and tabbed navigation patterns on both Android and iOS.
+
+If you're integrating React Native into an app that already manages navigation natively, or looking for an alternative to React Navigation, the following library provides native navigation on both platforms: [react-native-navigation](https://github.com/wix/react-native-navigation).
+
+## React Navigation
+
+The community solution to navigation is a standalone library that allows developers to set up the screens of an app with a few lines of code.
+
+### Installation and setup
+
+First, you need to install them in your project:
+
+```shell
+npm install @react-navigation/native @react-navigation/native-stack
+```
+
+Next, install the required peer dependencies. You need to run different commands depending on whether your project is an Expo managed project or a bare React Native project.
+
+- If you have an Expo managed project, install the dependencies with `expo`:
+
+ ```shell
+ expo install react-native-screens react-native-safe-area-context
+ ```
+
+- If you have a bare React Native project, install the dependencies with `npm`:
+
+ ```shell
+ npm install react-native-screens react-native-safe-area-context
+ ```
+
+ For iOS with bare React Native project, make sure you have [Cocoapods](https://cocoapods.org/) installed. Then install the pods to complete the installation:
+
+ ```shell
+ cd ios
+ pod install
+ cd ..
+ ```
+
+:::note
+You might get warnings related to peer dependencies after installation. They are usually caused by incorrect version ranges specified in some packages. You can safely ignore most warnings as long as your app builds.
+:::
+
+
+
+Now, you need to wrap the whole app in `NavigationContainer`. Usually you'd do this in your entry file, such as `index.js` or `App.js`:
+
+```jsx
+import * as React from 'react';
+import { NavigationContainer } from '@react-navigation/native';
+
+const App = () => {
+ return (
+
+ {/* Rest of your app code */}
+
+ );
+};
+
+export default App;
+```
+
+Now you are ready to build and run your app on the device/simulator.
+
+### Usage
+
+Now you can create an app with a home screen and a profile screen:
+
+```jsx
+import * as React from 'react';
+import { NavigationContainer } from '@react-navigation/native';
+import { createNativeStackNavigator } from '@react-navigation/native-stack';
+
+const Stack = createNativeStackNavigator();
+
+const MyStack = () => {
+ return (
+
+
+
+
+
+
+ );
+};
+```
+
+In this example, there are 2 screens (`Home` and `Profile`) defined using the `Stack.Screen` component. Similarly, you can define as many screens as you like.
+
+You can set options such as the screen title for each screen in the `options` prop of `Stack.Screen`.
+
+Each screen takes a `component` prop that is a React component. Those components receive a prop called `navigation` which has various methods to link to other screens. For example, you can use `navigation.navigate` to go to the `Profile` screen:
+
+```jsx
+const HomeScreen = ({ navigation }) => {
+ return (
+
+ navigation.navigate('Profile', { name: 'Jane' })
+ }
+ />
+ );
+};
+const ProfileScreen = ({ navigation, route }) => {
+ return This is {route.params.name}'s profile;
+};
+```
+
+This `native-stack` navigator uses the native APIs: `UINavigationController` on iOS and `Fragment` on Android so that navigation built with `createNativeStackNavigator` will behave the same and have the same performance characteristics as apps built natively on top of those APIs.
+
+React Navigation also has packages for different kind of navigators such as tabs and drawer. You can use them to implement various patterns in your app.
+
+For a complete intro to React Navigation, follow the [React Navigation Getting Started Guide](https://reactnavigation.org/docs/getting-started).
diff --git a/website/versioned_docs/version-0.70/network.md b/website/versioned_docs/version-0.70/network.md
new file mode 100644
index 00000000000..786e4db02cc
--- /dev/null
+++ b/website/versioned_docs/version-0.70/network.md
@@ -0,0 +1,266 @@
+---
+id: network
+title: Networking
+---
+
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+Many mobile apps need to load resources from a remote URL. You may want to make a POST request to a REST API, or you may need to fetch a chunk of static content from another server.
+
+## Using Fetch
+
+React Native provides the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) for your networking needs. Fetch will seem familiar if you have used `XMLHttpRequest` or other networking APIs before. You may refer to MDN's guide on [Using Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch) for additional information.
+
+### Making requests
+
+In order to fetch content from an arbitrary URL, you can pass the URL to fetch:
+
+```jsx
+fetch('https://mywebsite.com/mydata.json');
+```
+
+Fetch also takes an optional second argument that allows you to customize the HTTP request. You may want to specify additional headers, or make a POST request:
+
+```jsx
+fetch('https://mywebsite.com/endpoint/', {
+ method: 'POST',
+ headers: {
+ Accept: 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ firstParam: 'yourValue',
+ secondParam: 'yourOtherValue'
+ })
+});
+```
+
+Take a look at the [Fetch Request docs](https://developer.mozilla.org/en-US/docs/Web/API/Request) for a full list of properties.
+
+### Handling the response
+
+The above examples show how you can make a request. In many cases, you will want to do something with the response.
+
+Networking is an inherently asynchronous operation. Fetch method will return a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that makes it straightforward to write code that works in an asynchronous manner:
+
+```jsx
+const getMoviesFromApi = () => {
+ return fetch('https://reactnative.dev/movies.json')
+ .then((response) => response.json())
+ .then((json) => {
+ return json.movies;
+ })
+ .catch((error) => {
+ console.error(error);
+ });
+};
+```
+
+You can also use the `async` / `await` syntax in a React Native app:
+
+```jsx
+const getMoviesFromApiAsync = async () => {
+ try {
+ const response = await fetch(
+ 'https://reactnative.dev/movies.json'
+ );
+ const json = await response.json();
+ return json.movies;
+ } catch (error) {
+ console.error(error);
+ }
+};
+```
+
+Don't forget to catch any errors that may be thrown by `fetch`, otherwise they will be dropped silently.
+
+
+
+
+```SnackPlayer name=Fetch%20Example
+import React, { useEffect, useState } from 'react';
+import { ActivityIndicator, FlatList, Text, View } from 'react-native';
+
+export default App = () => {
+ const [isLoading, setLoading] = useState(true);
+ const [data, setData] = useState([]);
+
+ const getMovies = async () => {
+ try {
+ const response = await fetch('https://reactnative.dev/movies.json');
+ const json = await response.json();
+ setData(json.movies);
+ } catch (error) {
+ console.error(error);
+ } finally {
+ setLoading(false);
+ }
+ }
+
+ useEffect(() => {
+ getMovies();
+ }, []);
+
+ return (
+
+ {isLoading ? : (
+ id}
+ renderItem={({ item }) => (
+ {item.title}, {item.releaseYear}
+ )}
+ />
+ )}
+
+ );
+};
+```
+
+
+
+
+```SnackPlayer name=Fetch%20Example
+import React, { Component } from 'react';
+import { ActivityIndicator, FlatList, Text, View } from 'react-native';
+
+export default class App extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ data: [],
+ isLoading: true
+ };
+ }
+
+ async getMovies() {
+ try {
+ const response = await fetch('https://reactnative.dev/movies.json');
+ const json = await response.json();
+ this.setState({ data: json.movies });
+ } catch (error) {
+ console.log(error);
+ } finally {
+ this.setState({ isLoading: false });
+ }
+ }
+
+ componentDidMount() {
+ this.getMovies();
+ }
+
+ render() {
+ const { data, isLoading } = this.state;
+
+ return (
+
+ {isLoading ? : (
+ id}
+ renderItem={({ item }) => (
+ {item.title}, {item.releaseYear}
+ )}
+ />
+ )}
+
+ );
+ }
+};
+```
+
+
+
+
+> By default, iOS will block any request that's not encrypted using [SSL](https://hosting.review/web-hosting-glossary/#12). If you need to fetch from a cleartext URL (one that begins with `http`) you will first need to [add an App Transport Security exception](integration-with-existing-apps.md#test-your-integration). If you know ahead of time what domains you will need access to, it is more secure to add exceptions only for those domains; if the domains are not known until runtime you can [disable ATS completely](publishing-to-app-store.md#1-enable-app-transport-security). Note however that from January 2017, [Apple's App Store review will require reasonable justification for disabling ATS](https://forums.developer.apple.com/thread/48979). See [Apple's documentation](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33) for more information.
+
+> On Android, as of API Level 28, clear text traffic is also blocked by default. This behaviour can be overridden by setting [`android:usesCleartextTraffic`](https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic) in the app manifest file.
+
+## Using Other Networking Libraries
+
+The [XMLHttpRequest API](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest) is built into React Native. This means that you can use third party libraries such as [frisbee](https://github.com/niftylettuce/frisbee) or [axios](https://github.com/mzabriskie/axios) that depend on it, or you can use the XMLHttpRequest API directly if you prefer.
+
+```jsx
+var request = new XMLHttpRequest();
+request.onreadystatechange = (e) => {
+ if (request.readyState !== 4) {
+ return;
+ }
+
+ if (request.status === 200) {
+ console.log('success', request.responseText);
+ } else {
+ console.warn('error');
+ }
+};
+
+request.open('GET', 'https://mywebsite.com/endpoint/');
+request.send();
+```
+
+> The security model for XMLHttpRequest is different than on web as there is no concept of [CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) in native apps.
+
+## WebSocket Support
+
+React Native also supports [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket), a protocol which provides full-duplex communication channels over a single TCP connection.
+
+```jsx
+var ws = new WebSocket('ws://host.com/path');
+
+ws.onopen = () => {
+ // connection opened
+ ws.send('something'); // send a message
+};
+
+ws.onmessage = (e) => {
+ // a message was received
+ console.log(e.data);
+};
+
+ws.onerror = (e) => {
+ // an error occurred
+ console.log(e.message);
+};
+
+ws.onclose = (e) => {
+ // connection closed
+ console.log(e.code, e.reason);
+};
+```
+
+## Known Issues with `fetch` and cookie based authentication
+
+The following options are currently not working with `fetch`
+
+- `redirect:manual`
+- `credentials:omit`
+
+* Having same name headers on Android will result in only the latest one being present. A temporary solution can be found here: https://github.com/facebook/react-native/issues/18837#issuecomment-398779994.
+* Cookie based authentication is currently unstable. You can view some of the issues raised here: https://github.com/facebook/react-native/issues/23185
+* As a minimum on iOS, when redirected through a `302`, if a `Set-Cookie` header is present, the cookie is not set properly. Since the redirect cannot be handled manually this might cause a scenario where infinite requests occur if the redirect is the result of an expired session.
+
+## Configuring NSURLSession on iOS
+
+For some applications it may be appropriate to provide a custom `NSURLSessionConfiguration` for the underlying `NSURLSession` that is used for network requests in a React Native application running on iOS. For instance, one may need to set a custom user agent string for all network requests coming from the app or supply `NSURLSession` with an emphemeral `NSURLSessionConfiguration`. The function `RCTSetCustomNSURLSessionConfigurationProvider` allows for such customization. Remember to add the following import to the file in which `RCTSetCustomNSURLSessionConfigurationProvider` will be called:
+
+```objectivec
+#import
+```
+
+`RCTSetCustomNSURLSessionConfigurationProvider` should be called early in the application life cycle such that it is readily available when needed by React, for instance:
+
+```objectivec
+-(void)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+
+ // set RCTSetCustomNSURLSessionConfigurationProvider
+ RCTSetCustomNSURLSessionConfigurationProvider(^NSURLSessionConfiguration *{
+ NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
+ // configure the session
+ return configuration;
+ });
+
+ // set up React
+ _bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
+}
+```
diff --git a/website/versioned_docs/version-0.70/new-architecture-app-intro.md b/website/versioned_docs/version-0.70/new-architecture-app-intro.md
new file mode 100644
index 00000000000..dc7948d4dff
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-app-intro.md
@@ -0,0 +1,280 @@
+---
+id: new-architecture-app-intro
+title: Prerequisites for Applications
+---
+
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+
+
+
+There are a few prerequisites that should be addressed before the New Architecture is enabled in your application.
+
+## Use a React Native >= 0.68 release
+
+React Native released the support for the New Architecture with the release `0.68.0`.
+
+This guide is written with the expectation that you’re using the latest React Native release. At the moment of writing, this is `0.70.0`. Other than this guide, you can leverage the [upgrade helper](https://react-native-community.github.io/upgrade-helper/) to determine what other changes may be required for your project.
+
+To update to the most recent version of React Native, you can run this command:
+
+```bash
+yarn add react-native@0.70.0
+```
+
+Starting from React Native `0.69.0`, you may also need to update the version of React to 18. You can do so by using this command:
+
+```bash
+yarn add react@18.0.0
+```
+
+### Android specifics
+
+Using the New Architecture on Android has some prerequisites that you need to meet:
+
+1. Using Gradle 7.x and Android Gradle Plugin 7.x
+2. Using the **new React Gradle Plugin**
+3. Building `react-native` **from Source**
+
+You can update Gradle by running:
+
+```bash
+cd android && ./gradlew wrapper --gradle-version 7.3.3 --distribution-type=all
+```
+
+While the AGP version should be updated inside the **top-level** `build.gradle` file at the `com.android.tools.build:gradle` dependency line.
+
+Now, you can edit your **top-level** `settings.gradle` file to include the following line at the end of the file:
+
+```groovy
+includeBuild('../node_modules/react-native-gradle-plugin')
+
+include(":ReactAndroid")
+project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
+include(":ReactAndroid:hermes-engine")
+project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
+```
+
+Then, open the `android/app/src/main/AndroidManifest.xml` file and add this line:
+
+```diff
+android:windowSoftInputMode="adjustResize"
++ android:exported="true">
+
+```
+
+Then, edit your **top-level Gradle file** to include the highlighted lines:
+
+```groovy
+buildscript {
+ ext {
+ buildToolsVersion = "31.0.0"
+ minSdkVersion = 21
+ compileSdkVersion = 31
+ targetSdkVersion = 31
+ if (System.properties['os.arch'] == "aarch64") {
+ // For M1 Users we need to use the NDK 24 which added support for aarch64
+ ndkVersion = "24.0.8215888"
+ } else {
+ // Otherwise we default to the side-by-side NDK version from AGP.
+ ndkVersion = "21.4.7075529"
+ }
+ }
+
+ // ...
+ dependencies {
+ // Make sure that AGP is at least at version 7.x
+ classpath("com.android.tools.build:gradle:7.2.0")
+
+ // Add those lines
+ classpath("com.facebook.react:react-native-gradle-plugin")
+ classpath("de.undercouch:gradle-download-task:4.1.2")
+ }
+}
+```
+
+Edit your **module-level** **Gradle file** (usually `app/build.gradle[.kts]`) to include the following:
+
+```diff
+// ...
+
+apply plugin: "com.android.application"
+
+// ...
+
+if (enableHermes) {
+- def hermesPath = "../../node_modules/hermes-engine/android/";
+- debugImplementation files(hermesPath + "hermes-debug.aar")
+- releaseImplementation files(hermesPath + "hermes-release.aar")
++ //noinspection GradleDynamicVersion
++ implementation("com.facebook.react:hermes-engine:+") { // From node_modules
++ exclude group:'com.facebook.fbjni'
++ }
+} else {
+
+// ...
+
++ configurations.all {
++ resolutionStrategy.dependencySubstitution {
++ substitute(module("com.facebook.react:react-native"))
++ .using(project(":ReactAndroid"))
++ .because("On New Architecture we're building React Native from source")
++ substitute(module("com.facebook.react:hermes-engine"))
++ .using(project(":ReactAndroid:hermes-engine"))
++ .because("On New Architecture we're building Hermes from source")
++ }
++ }
+
+// Run this once to be able to run the application with BUCK
+// puts all compile dependencies into folder libs for BUCK to use
+task copyDownloadableDepsToLibs(type: Copy) {
+
+// ...
+
++ def isNewArchitectureEnabled() {
++ // To opt-in for the New Architecture, you can either:
++ // - Set `newArchEnabled` to true inside the `gradle.properties` file
++ // - Invoke gradle with `-newArchEnabled=true`
++ // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
++ return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
++ }
+```
+
+Finally, it’s time to update your project to use the `react-native` dependency from source, rather than using a precompiled artifact from the NPM package. This is needed as the later setup will rely on building the native code from source.
+
+Let’s edit your **module-level** `build.gradle` (the one inside `app/` folder) and change the following line:
+
+```diff
+dependencies {
+- implementation "com.facebook.react:react-native:+" // From node_modules
++ implementation project(":ReactAndroid") // From node_modules
+```
+
+## Use Hermes
+
+Hermes is an open-source JavaScript engine optimized for React Native. Hermes is enabled by default and you have to explicitly disable it if you want to use JSC.
+
+We highly recommend using Hermes in your application. With Hermes enabled, you will be able to use the JavaScript debugger in Flipper to directly debug your JavaScript code.
+
+Please [follow the instructions on the React Native website](hermes) to learn how to enable/disable Hermes.
+
+:::caution
+
+**iOS:** If you opt out of using Hermes, you will need to replace `HermesExecutorFactory` with `JSCExecutorFactory` in any examples used throughout the rest of this guide.
+
+:::
+
+### Android
+
+To enable Hermes in Android, open the `android/app/build.gradle` and apply the following changes:
+
+```diff
+project.ext.react = [
+- enableHermes: true, // clean and rebuild if changing
++ enableHermes: true, // clean and rebuild if changing
+]
+// ...
+
+}
+
+if (enableHermes) {
+- def hermesPath = "../../node_modules/hermes-engine/android/";
+- debugImplementation files(hermesPath + "hermes-debug.aar")
+- releaseImplementation files(hermesPath + "hermes-release.aar")
++ //noinspection GradleDynamicVersion
++ implementation("com.facebook.react:hermes-engine:+") { // From node_modules
++ exclude group:'com.facebook.fbjni'
++ }
+} else {
+```
+
+Moreover, you'll need to update the `proguard-rules`, adding the following ones:
+
+```
+-keep class com.facebook.hermes.unicode.** { *; }
+-keep class com.facebook.jni.** { *; }
+```
+
+After that, remember to cleanup the project, running
+
+```sh
+cd android
+./gradlew clean
+```
+
+## iOS: Make the project build
+
+After upgrading the project, there are a few changes you need to apply:
+
+1. Fix an API change in the `AppDelegate.m`. Open this file and apply this change:
+
+```diff
+#if DEBUG
+- return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
++ return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
+#else
+```
+
+2. Target the proper iOS version. Open the `Podfile` and apply this change:
+
+```diff
+- platform :ios, '11.0'
++ platform :ios, '12.4'
+```
+
+3. Create an `.xcode.env` file to export the locaion of the NODE_BINARY. Navigate to the `ios` folder and run this command:
+
+```sh
+echo 'export NODE_BINARY=$(command -v node)' > .xcode.env
+```
+
+If you need it, you can also open the file and replace the `$(command -v node)` with the path to the node executable.
+React Native supports also a local version of this file `.xcode.env.local`. This file is not synced with the repository to let you customize your local setup, if it differs from the Continuous Integration or the team one.
+
+## iOS: Use Objective-C++ (`.mm` extension)
+
+TurboModules can be written using Objective-C or C++. In order to support both cases, any source files that include C++ code should use the `.mm` file extension. This extension corresponds to Objective-C++, a language variant that allows for the use of a combination of C++ and Objective-C in source files.
+
+:::info
+
+Use Xcode to rename existing files to ensure file references persist in your project. You might need to clean the build folder (_Project → Clean Build Folder_) before re-building the app. If the file is renamed outside of Xcode, you may need to click on the old `.m` file reference and Locate the new file.
+
+:::
+
+## iOS: TurboModules: Ensure your App Provides an `RCTCxxBridgeDelegate`
+
+In order to set up the TurboModule system, you will add some code to interact with the bridge in your AppDelegate. Before you start, go ahead and rename your AppDelegate file to use the `.mm` extension.
+
+Now you will have your AppDelegate conform to `RCTCxxBridgeDelegate`. Start by adding the following imports at the top of your AppDelegate file:
+
+```objc
+#import
+#import
+#import
+```
+
+Then, declare your app delegate as a `RCTCxxBridgeDelegate` provider:
+
+```objc
+@interface AppDelegate () {
+ // ...
+}
+@end
+```
+
+To conform to the `RCTCxxBridgeDelegate` protocol, you will need to implement the `jsExecutorFactoryForBridge:` method. Typically, this is where you would return a `JSCExecutorFactory` or `HermesExecutorFactory`, and we will use it to install our TurboModules bindings later on.
+
+You can implement the `jsExecutorFactoryForBridge:` method like this:
+
+```objc
+#pragma mark - RCTCxxBridgeDelegate
+
+- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge
+{
+ return std::make_unique(facebook::react::RCTJSIExecutorRuntimeInstaller([bridge](facebook::jsi::Runtime &runtime) {
+ if (!bridge) {
+ return;
+ }
+ })
+ );
+}
+```
diff --git a/website/versioned_docs/version-0.70/new-architecture-app-modules-android.md b/website/versioned_docs/version-0.70/new-architecture-app-modules-android.md
new file mode 100644
index 00000000000..d6dd904f477
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-app-modules-android.md
@@ -0,0 +1,630 @@
+---
+id: new-architecture-app-modules-android
+title: Enabling TurboModule on Android
+---
+
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
+import constants from '@site/core/TabsConstants';
+
+
+
+Make sure your application meets all the [prerequisites](new-architecture-app-intro).
+
+## 1. Enable NDK and the native build
+
+:::caution
+
+In this iteration of the guide we’re setting up the project to let you build from source. You might notice an increase in your build time because of this.
+You can mitigate this by following the approach described in [Speeding up your Build phase](/docs/next/build-speed) guide.
+
+:::
+
+The Codegen will output some Java and some C++ code that now we need to build.
+
+Let’s edit your **module-level** `build.gradle` to include the **two** `externalNativeBuild` blocks detailed below inside the `android{}` block:
+
+```groovy
+android {
+ defaultConfig {
+ applicationId "com.awesomeproject"
+ // ...
+
+ // Add this block
+ externalNativeBuild {
+ ndkBuild {
+ arguments "APP_PLATFORM=android-21",
+ "APP_STL=c++_shared",
+ "NDK_TOOLCHAIN_VERSION=clang",
+ "GENERATED_SRC_DIR=$buildDir/generated/source",
+ "PROJECT_BUILD_DIR=$buildDir",
+ "REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
+ "REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
+ "NODE_MODULES_DIR=$rootDir/../node_modules"
+ cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
+ cppFlags "-std=c++17"
+ targets "myapplication_appmodules"
+ // Fix for windows limit on number of character in file paths and in command lines
+ if (Os.isFamily(Os.FAMILY_WINDOWS)) {
+ arguments "NDK_APP_SHORT_COMMANDS=true"
+ }
+ }
+ }
+ }
+
+ // Add this block
+ externalNativeBuild {
+ ndkBuild {
+ path "$projectDir/src/main/jni/Android.mk"
+ }
+ }
+}
+```
+
+In the same `build.gradle` file, inside the same `android{}` let’s add also the following section:
+
+```groovy
+android {
+ // ...
+
+ def reactAndroidProjectDir = project(':ReactAndroid').projectDir
+ def packageReactNdkLibs = tasks.register("packageReactNdkLibs", Copy) {
+ dependsOn(":ReactAndroid:packageReactNdkLibsForBuck")
+ dependsOn("generateCodegenArtifactsFromSchema")
+ from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
+ into("$buildDir/react-ndk/exported")
+ }
+
+ afterEvaluate {
+ preBuild.dependsOn(packageReactNdkLibs)
+ configureNdkBuildDebug.dependsOn(preBuild)
+ configureNdkBuildRelease.dependsOn(preBuild)
+ }
+
+ packagingOptions {
+ pickFirst '**/libhermes.so'
+ pickFirst '**/libjsc.so'
+ }
+}
+```
+
+Finally, we need to create a Makefile inside the `src/main/jni` folder called `Android.mk` with the following content:
+
+```makefile
+THIS_DIR := $(call my-dir)
+
+include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
+
+# If you wish to add a custom TurboModule or Fabric component in your app you
+# will have to include the following autogenerated makefile.
+# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
+
+# Includes the MK file for autolinked libraries
+include $(PROJECT_BUILD_DIR)/generated/rncli/src/main/jni/Android-rncli.mk
+
+include $(CLEAR_VARS)
+
+LOCAL_PATH := $(THIS_DIR)
+
+# You can customize the name of your application .so file here.
+LOCAL_MODULE := awesomeapp_appmodules
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH) $(PROJECT_BUILD_DIR)/generated/rncli/src/main/jni
+LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(PROJECT_BUILD_DIR)/generated/rncli/src/main/jni/*.cpp)
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(PROJECT_BUILD_DIR)/generated/rncli/src/main/jni
+
+# If you wish to add a custom TurboModule or Fabric component in your app you
+# will have to uncomment those lines to include the generated source
+# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
+#
+# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
+# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)
+# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
+
+# Here you should add any native library you wish to depend on.
+LOCAL_SHARED_LIBRARIES := \
+libfabricjni \
+libfbjni \
+libfolly_runtime \
+libglog \
+libjsi \
+libreact_codegen_rncore \
+libreact_debug \
+libreact_nativemodule_core \
+libreact_render_componentregistry \
+libreact_render_core \
+libreact_render_debug \
+libreact_render_graphics \
+librrc_view \
+libruntimeexecutor \
+libturbomodulejsijni \
+libyoga
+
+# Autolinked libraries
+LOCAL_SHARED_LIBRARIES += $(call import-codegen-modules)
+
+LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17
+
+include $(BUILD_SHARED_LIBRARY)
+```
+
+This setup will run a native build on your project and will compile the C++ files that have been generated by the codegen. You will see the native build running with the Gradle task `:app:externalNativeBuildDebug`
+
+You can now verify that everything works correctly by running your android app:
+
+```bash
+yarn react-native run-android
+```
+
+## 2. Java/Kotlin - Provide a `ReactPackageTurboModuleManagerDelegate`
+
+Now is time to actually use the TurboModule.
+First, we will need to create a `ReactPackageTurboModuleManagerDelegate` subclass, like the following:
+
+
+
+
+```java
+package com.awesomeproject;
+
+import com.facebook.jni.HybridData;
+import com.facebook.react.ReactPackage;
+import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.soloader.SoLoader;
+
+import java.util.List;
+
+public class MyApplicationTurboModuleManagerDelegate extends ReactPackageTurboModuleManagerDelegate {
+
+ private static volatile boolean sIsSoLibraryLoaded;
+
+ protected MyApplicationTurboModuleManagerDelegate(ReactApplicationContext reactApplicationContext, List packages) {
+ super(reactApplicationContext, packages);
+ }
+
+ protected native HybridData initHybrid();
+
+ public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
+ protected MyApplicationTurboModuleManagerDelegate build(
+ ReactApplicationContext context, List packages) {
+ return new MyApplicationTurboModuleManagerDelegate(context, packages);
+ }
+ }
+
+ @Override
+ protected synchronized void maybeLoadOtherSoLibraries() {
+ // Prevents issues with initializer interruptions.
+ if (!sIsSoLibraryLoaded) {
+ SoLoader.loadLibrary("myapplication_appmodules");
+ sIsSoLibraryLoaded = true;
+ }
+ }
+}
+```
+
+
+
+
+
+```kotlin
+package com.awesomeproject
+
+import com.facebook.jni.HybridData
+import com.facebook.react.ReactPackage
+import com.facebook.react.ReactPackageTurboModuleManagerDelegate
+import com.facebook.react.bridge.ReactApplicationContext
+import com.facebook.soloader.SoLoader
+
+class MyApplicationTurboModuleManagerDelegate
+protected constructor(
+ reactApplicationContext: ReactApplicationContext,
+ packages: List
+) : ReactPackageTurboModuleManagerDelegate(reactApplicationContext, packages) {
+
+ override protected external fun initHybrid(): HybridData?
+ class Builder : ReactPackageTurboModuleManagerDelegate.Builder() {
+ override protected fun build(
+ context: ReactApplicationContext,
+ packages: List
+ ): MyApplicationTurboModuleManagerDelegate =
+ MyApplicationTurboModuleManagerDelegate(context, packages)
+ }
+
+ @Synchronized
+ override protected fun maybeLoadOtherSoLibraries() {
+ // Prevents issues with initializer interruptions.
+ if (!isSoLibraryLoaded) {
+ SoLoader.loadLibrary("myapplication_appmodules")
+ isSoLibraryLoaded = true
+ }
+ }
+
+ companion object {
+ @Volatile private var isSoLibraryLoaded = false
+ }
+}
+```
+
+
+
+
+Please note that the `SoLoader.loadLibrary` parameter (in this case `"myapplication_appmodules")` should be the same as the one specified for `LOCAL_MODULE :=` inside the `Android.mk` file you created before.
+
+This class will then be responsible of loading the TurboModules and will take care of loading the native library build with the NDK at runtime.
+
+## 3. Adapt your `ReactNativeHost` to use the `ReactPackageTurboModuleManagerDelegate`
+
+Then, you can provide the class you created to your `ReactNativeHost`. You can locate your `ReactNativeHost` by searching for the `getReactNativeHost()`. The `ReactNativeHost` is usually located inside your `Application` class.
+
+Once you located it, you need to add the `getReactPackageTurboModuleManagerDelegateBuilder` method as from the snippet below:
+
+
+
+
+```java
+public class MyApplication extends Application implements ReactApplication {
+
+ private final ReactNativeHost mReactNativeHost =
+ new ReactNativeHost(this) {
+ @Override
+ public boolean getUseDeveloperSupport() { /* ... */ }
+
+ @Override
+ protected List getPackages() { /* ... */ }
+
+ @Override
+ protected String getJSMainModuleName() {/* ... */ }
+
+ @NonNull
+ @Override
+ protected ReactPackageTurboModuleManagerDelegate.Builder getReactPackageTurboModuleManagerDelegateBuilder() {
+ return new MyApplicationTurboModuleManagerDelegate.Builder();
+ }
+ };
+}
+```
+
+
+
+
+```kotlin
+class MyApplication : Application(), ReactApplication {
+ private val reactNativeHost: ReactNativeHost =
+ object : ReactNativeHost(this) {
+
+ override fun getUseDeveloperSupport(): Boolean {
+ /* ... */
+ }
+
+ override fun getPackages(): List? {
+ /* ... */
+ }
+
+ override fun getJSMainModuleName(): String? {
+ /* ... */
+ }
+
+ @NonNull
+ override fun getReactPackageTurboModuleManagerDelegateBuilder() =
+ ReactPackageTurboModuleManagerDelegate.Builder()
+ }
+}
+```
+
+
+
+
+## 4. Extend the `getPackages()` from your `ReactNativeHost` to use the TurboModule
+
+Still on the `ReactNativeHost` , we need to extend the the `getPackages()` method to include the newly created TurboModule. Update the method to include the following:
+
+
+
+
+```java
+public class MyApplication extends Application implements ReactApplication {
+
+ private final ReactNativeHost mReactNativeHost =
+ new ReactNativeHost(this) {
+ @Override
+ public boolean getUseDeveloperSupport() { /* ... */ }
+
+ @Override
+ protected List getPackages() {
+ List packages = new PackageList(this).getPackages();
+
+ // Add those lines
+ packages.add(new TurboReactPackage() {
+ @Nullable
+ @Override
+ public NativeModule getModule(String name, ReactApplicationContext reactContext) {
+ if (name.equals(NativeAwesomeManager.NAME)) {
+ return new NativeAwesomeManager(reactContext);
+ } else {
+ return null;
+ }
+ }
+
+ @Override
+ public ReactModuleInfoProvider getReactModuleInfoProvider() {
+ return () -> {
+ final Map moduleInfos = new HashMap<>();
+ moduleInfos.put(
+ NativeAwesomeManager.NAME,
+ new ReactModuleInfo(
+ NativeAwesomeManager.NAME,
+ "NativeAwesomeManager",
+ false, // canOverrideExistingModule
+ false, // needsEagerInit
+ true, // hasConstants
+ false, // isCxxModule
+ true // isTurboModule
+ )
+ );
+ return moduleInfos;
+ };
+ }
+ });
+ return packages;
+ }
+
+ @Override
+ protected String getJSMainModuleName() {/* ... */ }
+
+ @NonNull
+ @Override
+ protected ReactPackageTurboModuleManagerDelegate.Builder getReactPackageTurboModuleManagerDelegateBuilder() {
+ return new MyApplicationTurboModuleManagerDelegate.Builder();
+ }
+ };
+}
+```
+
+
+
+
+```kotlin
+class MyApplication() : Application(), ReactApplication {
+
+ private val reactNativeHost: ReactNativeHost =
+ object : ReactNativeHost(this) {
+ override fun getUseDeveloperSupport(): Boolean {
+ /* ... */
+ }
+
+ override protected fun getPackages(): List? {
+ val packages: MutableList = PackageList(this).getPackages()
+
+ // Add those lines
+ packages.add(
+ object : TurboReactPackage() {
+ @Nullable
+ override fun getModule(
+ name: String,
+ reactContext: ReactApplicationContext?
+ ): NativeModule? =
+ if ((name == NativeAwesomeManager.NAME)) {
+ NativeAwesomeManager(reactContext)
+ } else {
+ null
+ }
+
+ override fun getReactModuleInfoProvider() =
+ mutableMapOf(
+ NativeAwesomeManager.NAME,
+ ReactModuleInfo(
+ NativeAwesomeManager.NAME,
+ "NativeAwesomeManager",
+ false, // canOverrideExistingModule
+ false, // needsEagerInit
+ true, // hasConstants
+ false, // isCxxModule
+ true // isTurboModule
+ )
+ )
+ }
+ )
+ return packages
+ }
+
+ override protected fun getJSMainModuleName(): String? {
+ /* ... */
+ }
+
+ @NonNull
+ override protected fun getReactPackageTurboModuleManagerDelegateBuilder():
+ ReactPackageTurboModuleManagerDelegate.Builder? {
+ return Builder()
+ }
+ }
+}
+```
+
+
+
+
+## 5. C++ Provide a native implementation for the methods in your `*TurboModuleDelegate` class
+
+If you take a closer look at the class `MyApplicationTurboModuleManagerDelegate` that you created before, you will notice how some of the methods are `native`.
+
+Therefore, you need to provide some C++ classes to implement those methods. Specifically you will need those files, to be added inside the `src/main/jni` folder:
+
+- `MyApplicationTurboModuleManagerDelegate.h` An header file for the TurboModule Delegate.
+- `MyApplicationTurboModuleManagerDelegate.cpp` The implementation of the aforementioned header file.
+- `MyApplicationModuleProvider.h` A header file for the TurboModule provider, where you can specify which TurboModules you want to load.
+- `MyApplicationModuleProvider.cpp` The implementation for the aforementioned header file.
+- `OnLoad.cpp` Where the initialisation code will be placed. Specifically TurboModule uses FBJNI so the initialisation for such library lives there.
+
+The content of those files should be the following:
+
+#### MyApplicationTurboModuleManagerDelegate.h
+
+Please note that the `kJavaDescriptor` should be adapted to follow the package name you picked for your project.
+
+```cpp
+#include
+#include
+
+#include
+#include
+
+namespace facebook {
+namespace react {
+
+class MyApplicationTurboModuleManagerDelegate : public jni::HybridClass {
+public:
+ // Adapt it to the package you used for your Java class.
+ static constexpr auto kJavaDescriptor =
+ "Lcom/awesomeproject/MyApplicationTurboModuleManagerDelegate;";
+
+ static jni::local_ref initHybrid(jni::alias_ref);
+
+ static void registerNatives();
+
+ std::shared_ptr getTurboModule(const std::string name, const std::shared_ptr jsInvoker) override;
+ std::shared_ptr getTurboModule(const std::string name, const JavaTurboModule::InitParams ¶ms) override;
+
+private:
+ friend HybridBase;
+ using HybridBase::HybridBase;
+
+};
+
+} // namespace react
+} // namespace facebook
+```
+
+#### MyApplicationTurboModuleManagerDelegate.cpp
+
+```cpp
+#include "MyApplicationTurboModuleManagerDelegate.h"
+#include "MyApplicationModuleProvider.h"
+
+namespace facebook {
+namespace react {
+
+jni::local_ref MyApplicationTurboModuleManagerDelegate::initHybrid(jni::alias_ref) {
+ return makeCxxInstance();
+}
+
+void MyApplicationTurboModuleManagerDelegate::registerNatives() {
+ registerHybrid({
+ makeNativeMethod("initHybrid", MyApplicationTurboModuleManagerDelegate::initHybrid),
+ });
+}
+
+std::shared_ptr MyApplicationTurboModuleManagerDelegate::getTurboModule(const std::string name, const std::shared_ptr jsInvoker) {
+ // Not implemented yet: provide pure-C++ NativeModules here.
+ return nullptr;
+}
+
+std::shared_ptr MyApplicationTurboModuleManagerDelegate::getTurboModule(const std::string name, const JavaTurboModule::InitParams ¶ms) {
+ return MyApplicationModuleProvider(name, params);
+}
+
+} // namespace react
+} // namespace facebook
+```
+
+#### MyApplicationModuleProvider.h
+
+```cpp
+#pragma once
+
+#include
+#include
+
+#include
+
+namespace facebook {
+namespace react {
+
+std::shared_ptr MyApplicationModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms);
+
+} // namespace react
+} // namespace facebook
+```
+
+#### MyApplicationModuleProvider.cpp
+
+Please adapt the `samplelibrary.h` import to match the same library name you provided when building the apps.
+This is the C++ generated file that is created by the codegen.
+
+Here you can also specify more than one provider, should you have more than one TurboModule. Specifically in this example we look for a TurboModule from `samplelibrary` (the one we specified) and we fallback to the `rncore` Module Provider (containing all the Core modules).
+
+```cpp
+#include "MyApplicationModuleProvider.h"
+
+#include
+#include
+
+namespace facebook {
+namespace react {
+
+std::shared_ptr MyApplicationModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams ¶ms) {
+ auto module = samplelibrary_ModuleProvider(moduleName, params);
+ if (module != nullptr) {
+ return module;
+ }
+
+ return rncore_ModuleProvider(moduleName, params);
+}
+
+} // namespace react
+} // namespace facebook
+```
+
+#### OnLoad.cpp
+
+```cpp
+#include
+#include "MyApplicationTurboModuleManagerDelegate.h"
+
+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
+ return facebook::jni::initialize(vm, [] {
+ facebook::react::MyApplicationTurboModuleManagerDelegate::registerNatives();
+ });
+}
+```
+
+## 6. Enable the `useTurboModules` flag in your Application `onCreate`
+
+Now you can finally enable the `TurboModule `support in your Application. To do so, you need to turn on the `useTurboModule` flag inside your Application `onCreate` method.
+
+
+
+
+```java
+public class MyApplication extends Application implements ReactApplication {
+
+ @Override
+ public void onCreate() {
+ ReactFeatureFlags.useTurboModules = true;
+ //...
+ }
+}
+```
+
+
+
+
+
+```kotlin
+class MyApplication : Application(), ReactApplication {
+
+ override fun onCreate() {
+ ReactFeatureFlags.useTurboModules = true
+ // ...
+ }
+}
+```
+
+
+
+
+It’s now time to run again your Android app to verify that everything works correctly:
+
+```bash
+yarn react-native run-android
+```
diff --git a/website/versioned_docs/version-0.70/new-architecture-app-modules-ios.md b/website/versioned_docs/version-0.70/new-architecture-app-modules-ios.md
new file mode 100644
index 00000000000..ca6f9306a1c
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-app-modules-ios.md
@@ -0,0 +1,173 @@
+---
+id: new-architecture-app-modules-ios
+title: Enabling TurboModule on iOS
+---
+
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+
+
+
+Make sure your application meets all the [prerequisites](new-architecture-app-intro).
+
+## 1. Provide a TurboModuleManager Delegate
+
+Add the following imports at the top of your bridge delegate (e.g. `AppDelegate.mm`):
+
+```objc
+#import
+#import
+```
+
+You will also need to declare that your AppDelegate conforms to the `RCTTurboModuleManagerDelegate` protocol, as well as create an instance variable for our Turbo Module manager:
+
+```objc
+@interface AppDelegate () {
+ // ...
+ RCTTurboModuleManager *_turboModuleManager;
+}
+@end
+```
+
+To conform to the `RCTTurboModuleManagerDelegate` protocol, you will implement these three methods:
+
+- `getModuleClassFromName:` - This method should return the Class for a native module. You may use the `RCTCoreModulesClassProvider()` method to handle the default, core modules.
+- `getTurboModule:jsInvoker:` - This should return `nullptr`. This method may be used later to support C++ TurboModules.
+- `getModuleInstanceFromClass:moduleClass:` - This method allows you to perform any side-effects when your TurboModules are initialized. This is the TurboModule analogue to your bridge delegate’s `extraModulesForBridge` method. At this time, you’ll need to initialize the default RCTNetworking and RCTImageLoader modules as indicated below.
+
+#### TurboModuleManagerDelegate Example
+
+Take note of `getModuleInstanceFromClass:` in the following example, as it includes some necessary instantiation of several core modules that you will need to include in your application. Eventually, this may not be required.
+
+```objc title='AppDelegate.mm'
+// ...
+
+#import
+#import
+#import
+#import
+#import
+#import
+#import
+
+#import
+
+#import
+
+// ...
+
+#pragma mark RCTTurboModuleManagerDelegate
+
+- (Class)getModuleClassFromName:(const char *)name
+{
+ return RCTCoreModulesClassProvider(name);
+}
+
+- (std::shared_ptr)
+ getTurboModule:(const std::string &)name
+ jsInvoker:(std::shared_ptr)jsInvoker {
+ return nullptr;
+}
+
+- (id)getModuleInstanceFromClass:(Class)moduleClass
+{
+ // Set up the default RCTImageLoader and RCTNetworking modules.
+ if (moduleClass == RCTImageLoader.class) {
+ return [[moduleClass alloc] initWithRedirectDelegate:nil
+ loadersProvider:^NSArray> *(RCTModuleRegistry * moduleRegistry) {
+ return @ [[RCTLocalAssetImageLoader new]];
+ }
+ decodersProvider:^NSArray> *(RCTModuleRegistry * moduleRegistry) {
+ return @ [[RCTGIFImageDecoder new]];
+ }];
+ } else if (moduleClass == RCTNetworking.class) {
+ return [[moduleClass alloc]
+ initWithHandlersProvider:^NSArray> *(
+ RCTModuleRegistry *moduleRegistry) {
+ return @[
+ [RCTHTTPRequestHandler new],
+ [RCTDataRequestHandler new],
+ [RCTFileRequestHandler new],
+ ];
+ }];
+ }
+ // No custom initializer here.
+ return [moduleClass new];
+}
+```
+
+## 2. Install TurboModuleManager JavaScript Bindings
+
+Next, you will create a `RCTTurboModuleManager` in your bridge delegate’s `jsExecutorFactoryForBridge:` method, and install the JavaScript bindings:
+
+```objc
+#pragma mark - RCTCxxBridgeDelegate
+
+- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge
+{
+ // Add these lines to create a TurboModuleManager
+ if (RCTTurboModuleEnabled()) {
+ _turboModuleManager =
+ [[RCTTurboModuleManager alloc] initWithBridge:bridge
+ delegate:self
+ jsInvoker:bridge.jsCallInvoker];
+
+ // Necessary to allow NativeModules to lookup TurboModules
+ [bridge setRCTTurboModuleRegistry:_turboModuleManager];
+
+ if (!RCTTurboModuleEagerInitEnabled()) {
+ /**
+ * Instantiating DevMenu has the side-effect of registering
+ * shortcuts for CMD + d, CMD + i, and CMD + n via RCTDevMenu.
+ * Therefore, when TurboModules are enabled, we must manually create this
+ * NativeModule.
+ */
+ [_turboModuleManager moduleForName:"DevMenu"];
+ }
+ }
+
+ // Add this line...
+ __weak __typeof(self) weakSelf = self;
+
+ // If you want to use the `JSCExecutorFactory`, remember to add the `#import `
+ // import statement on top.
+ return std::make_unique(
+ facebook::react::RCTJSIExecutorRuntimeInstaller([weakSelf, bridge](facebook::jsi::Runtime &runtime) {
+ if (!bridge) {
+ return;
+ }
+
+ // And add these lines to install the bindings...
+ __typeof(self) strongSelf = weakSelf;
+ if (strongSelf) {
+ facebook::react::RuntimeExecutor syncRuntimeExecutor =
+ [&](std::function &&callback) { callback(runtime); };
+ [strongSelf->_turboModuleManager installJSBindingWithRuntimeExecutor:syncRuntimeExecutor];
+ }
+ }));
+}
+```
+
+## 3. Enable TurboModule System
+
+Finally, enable TurboModules in your app by executing the following statement before React Native is initialized in your app delegate (e.g. within `didFinishLaunchingWithOptions:`):
+
+```objc
+RCTEnableTurboModule(YES);
+```
+
+#### Example
+
+```objc
+@implementation AppDelegate
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+ RCTEnableTurboModule(YES);
+
+ RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
+ launchOptions:launchOptions];
+
+ // ...
+
+ return YES;
+}
+```
diff --git a/website/versioned_docs/version-0.70/new-architecture-app-renderer-android.md b/website/versioned_docs/version-0.70/new-architecture-app-renderer-android.md
new file mode 100644
index 00000000000..4b7bbe88b04
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-app-renderer-android.md
@@ -0,0 +1,453 @@
+---
+id: new-architecture-app-renderer-android
+title: Enabling Fabric on Android
+---
+
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+
+
+
+Make sure your application meets all the [prerequisites](new-architecture-app-intro).
+
+## 1. Provide a `JSIModulePackage` inside your `ReactNativeHost`
+
+In order to enable Fabric in your app, you would need to add a `JSIModulePackage` inside your `ReactNativeHost`. If you followed the TurboModule section of this guide, you probably already know where to find your `ReactNativeHost`. If not, you can locate your `ReactNativeHost` by searching for the `getReactNativeHost()`. The `ReactNativeHost` is usually located inside your `Application` class.
+
+Once you located it, you need to add the `getJSIModulePackage` method as from the snippet below:
+
+```java title='MyApplication.java'
+public class MyApplication extends Application implements ReactApplication {
+
+ private final ReactNativeHost mReactNativeHost =
+ new ReactNativeHost(this) {
+
+ // Add those lines:
+ @Nullable
+ @Override
+ protected JSIModulePackage getJSIModulePackage() {
+ return new JSIModulePackage() {
+ @Override
+ public List getJSIModules(
+ final ReactApplicationContext reactApplicationContext,
+ final JavaScriptContextHolder jsContext) {
+ final List specs = new ArrayList<>();
+ specs.add(new JSIModuleSpec() {
+ @Override
+ public JSIModuleType getJSIModuleType() {
+ return JSIModuleType.UIManager;
+ }
+
+ @Override
+ public JSIModuleProvider getJSIModuleProvider() {
+ final ComponentFactory componentFactory = new ComponentFactory();
+ CoreComponentsRegistry.register(componentFactory);
+ final ReactInstanceManager reactInstanceManager = getReactInstanceManager();
+
+ ViewManagerRegistry viewManagerRegistry =
+ new ViewManagerRegistry(
+ reactInstanceManager.getOrCreateViewManagers(
+ reactApplicationContext));
+
+ return new FabricJSIModuleProvider(
+ reactApplicationContext,
+ componentFactory,
+ new EmptyReactNativeConfig(),
+ viewManagerRegistry);
+ }
+ });
+ return specs;
+ }
+ };
+ }
+ };
+}
+```
+
+## 2. Make sure your call `setIsFabric` on your Activity’s `ReactRootView`
+
+Inside your `Activity` class, you need to make sure you’re calling `setIsFabric` on the `ReactRootView`.
+If you don’t have a `ReactActivityDelegate` you might need to create one.
+
+```java
+public class MainActivity extends ReactActivity {
+
+ // Add the Activity Delegate, if you don't have one already.
+ public static class MainActivityDelegate extends ReactActivityDelegate {
+
+ public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
+ super(activity, mainComponentName);
+ }
+
+ @Override
+ protected ReactRootView createRootView() {
+ ReactRootView reactRootView = new ReactRootView(getContext());
+
+ // Make sure to call setIsFabric(true) on your ReactRootView
+ reactRootView.setIsFabric(true);
+ return reactRootView;
+ }
+ }
+
+ // Make sure to override the `createReactActivityDelegate()` method.
+ @Override
+ protected ReactActivityDelegate createReactActivityDelegate() {
+ return new MainActivityDelegate(this, getMainComponentName());
+ }
+}
+```
+
+The crucial part in this code is the `reactRootView.setIsFabric(true)` which will enable the new renderer for this Activity.
+
+You can now verify that everything works correctly by running your android app:
+
+```bash
+yarn react-native run-android
+```
+
+In your Metro terminal log, you will now see the following log to confirm that Fabric is running correctly:
+
+```
+BUNDLE ./App.js
+LOG Running "App" with {"fabric":true,"initialProps":{},"rootTag":1}
+```
+
+## Migrating Android ViewManagers
+
+First, make sure you followed the instructions to [Enabling the New Renderer (Fabric) in Your Android Application](#enabling-the-new-renderer-fabric-in-your-android-application). Plus we will also assume that you followed the instructions from [Enabling the New NativeModule System (TurboModule) in Your Android Application](#enabling-the-new-nativemodule-system-turbomodule-in-your-android-application) as the Makefile (`Android.mk`) and other native builds setup steps are presented over there and won’t be repeated here.
+
+### JavaScript changes
+
+1. Make sure your other JS changes are ready to go by following Preparing your JavaScript codebase for the new React Native Renderer (Fabric)
+2. Replace the call to `requireNativeComponent` with `codegenNativeComponent`. This tells the JS codegen to start generating the native implementation of the component, consisting of C++ and Java classes. This is how it looks for the WebView component:
+
+```ts
+import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
+
+// babel-plugin-codegen will replace the function call to use NativeComponentRegistry
+// 'RCTWebView' is interopped by RCTFabricComponentsPlugins
+
+export default (codegenNativeComponent(
+ 'RCTWebView',
+): HostComponent);
+```
+
+4. **[Flow users]** Make sure your native component has Flow types for its props, since the JS codegen uses these types to generate the type-safe native implementation of the component. The codegen generates C++ classes during the build time, which guarantees that the native implementation is always up-to-date with its JS interface. Use [these c++ compatible types](https://github.com/facebook/react-native/blob/main/Libraries/Types/CodegenTypes.js#L28-L30).
+
+```ts title="RNTMyNativeViewNativeComponent.js"
+import type {Int32} from 'react-native/Libraries/Types/CodegenTypes';
+import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
+import type {HostComponent} from 'react-native';
+import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
+
+type NativeProps = $ReadOnly<{|
+ ...ViewProps, // This is required.
+ someNumber: Int32,
+|}>;
+
+[...]
+
+export default (codegenNativeComponent(
+ 'RNTMyNativeView',
+): HostComponent);
+```
+
+5. **[TypeScript users]** We are currently investigating a support for TypeScript.
+
+### Native/Java Changes
+
+1. **Update (or Create) your ViewManager to use the generated classes from the Codegen.**
+
+Specifically you will have to implement the generated **ViewManagerInterface** and to pass events to the generated **ViewManagerDelegate.**
+Your ViewManager could follow this structure. The MyNativeView class in this example is an Android View implementation (like a subclass of LinearLayout, Button, TextView, etc.)
+
+```java title='MyNativeViewManager.java'
+// View manager for MyNativeView components.
+@ReactModule(name = MyNativeViewManager.REACT_CLASS)
+public class MyNativeViewManager extends SimpleViewManager
+ implements RNTMyNativeViewManagerInterface {
+
+ public static final String REACT_CLASS = "RNTMyNativeView";
+
+ private final ViewManagerDelegate mDelegate;
+
+ public MyNativeViewManager() {
+ mDelegate = new RNTMyNativeViewManagerDelegate<>(this);
+ }
+
+ @Nullable
+ @Override
+ protected ViewManagerDelegate getDelegate() {
+ return mDelegate;
+ }
+
+ @NonNull
+ @Override
+ public String getName() {
+ return REACT_CLASS;
+ }
+
+ @NonNull
+ @Override
+ protected MyNativeView createViewInstance(@NonNull ThemedReactContext reactContext) {
+ return new MyNativeView(reactContext);
+ }
+}
+```
+
+1. **Add your ViewManager to one of the Packages loaded by your Application.**
+
+Specifically inside the `ReactNativeHost` , update `getPackages` method to include the following:
+
+```java
+public class MyApplication extends Application implements ReactApplication {
+
+ private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
+ @Override
+ public boolean getUseDeveloperSupport() { /* ... */ }
+
+ @Override
+ protected List getPackages() {
+ List packages = new PackageList(this).getPackages();
+
+ // ... other packages or `TurboReactPackage added` here...
+
+ // Add those lines.
+ packages.add(new ReactPackage() {
+ @NonNull
+ @Override
+ public List createNativeModules(
+ @NonNull ReactApplicationContext reactContext) {
+ return Collections.emptyList();
+ }
+
+ @NonNull
+ @Override
+ public List createViewManagers(
+ @NonNull ReactApplicationContext reactContext) {
+ // Your ViewManager is returned here.
+ return Collections.singletonList(new MyNativeViewManager());
+ }
+ });
+ return packages;
+ }
+ };
+}
+```
+
+3. **Add a Fabric Component Registry**
+
+You need to create a new component Registry that will allow you to **register** your components to be discovered by Fabric. Let’s create the `MyComponentsRegistry` file with the following content.
+
+As you can see, some methods are `native()` which we will implement in C++ in the following paragraph.
+
+```java
+package com.awesomeproject;
+
+import com.facebook.jni.HybridData;
+import com.facebook.proguard.annotations.DoNotStrip;
+import com.facebook.react.fabric.ComponentFactory;
+import com.facebook.soloader.SoLoader;
+
+@DoNotStrip
+public class MyComponentsRegistry {
+ static {
+ SoLoader.loadLibrary("fabricjni");
+ }
+
+ @DoNotStrip private final HybridData mHybridData;
+
+ @DoNotStrip
+ private native HybridData initHybrid(ComponentFactory componentFactory);
+
+ @DoNotStrip
+ private MyComponentsRegistry(ComponentFactory componentFactory) {
+ mHybridData = initHybrid(componentFactory);
+ }
+
+ @DoNotStrip
+ public static MyComponentsRegistry register(ComponentFactory componentFactory) {
+ return new MyComponentsRegistry(componentFactory);
+ }
+}
+```
+
+4. **Register your custom Fabric Component Registry**
+
+Finally, let’s edit the `getJSIModulePackage` from the `ReactNativeHost` to also register your Component Registry alongside the Core one:
+
+```java
+public class MyApplication extends Application implements ReactApplication {
+
+ private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
+ @Nullable
+ @Override
+ protected JSIModulePackage getJSIModulePackage() {
+ return new JSIModulePackage() {
+ @Override
+ public List getJSIModules(
+ final ReactApplicationContext reactApplicationContext,
+ final JavaScriptContextHolder jsContext) {
+ final List specs = new ArrayList<>();
+ specs.add(new JSIModuleSpec() {
+ // ...
+
+ @Override
+ public JSIModuleProvider getJSIModuleProvider() {
+ final ComponentFactory componentFactory = new ComponentFactory();
+ CoreComponentsRegistry.register(componentFactory);
+
+ // Add this line just below CoreComponentsRegistry.register
+ MyComponentsRegistry.register(componentFactory);
+
+ // ...
+ }
+ });
+ return specs;
+ }
+ };
+ }
+ };
+}
+```
+
+### Native/C++ Changes
+
+It’s now time to provide an implementation for your `MyComponentsRegistry` in C++:
+
+1. **Create a header file: `MyComponentsRegistry.h`**
+
+The file should be placed inside the `src/main/jni` folder.
+Please note that the `kJavaDescriptor` should be adapted to follow the package name you picked for your project.
+
+```cpp title="MyComponentsRegistry.h"
+#pragma once
+
+#include
+#include
+#include
+#include
+
+namespace facebook {
+namespace react {
+
+class MyComponentsRegistry
+ : public facebook::jni::HybridClass {
+ public:
+ constexpr static auto kJavaDescriptor =
+ "Lcom/awesomeproject/MyComponentsRegistry;";
+
+ static void registerNatives();
+
+ MyComponentsRegistry(ComponentFactory *delegate);
+
+ private:
+ friend HybridBase;
+
+ static std::shared_ptr
+ sharedProviderRegistry();
+
+ const ComponentFactory *delegate_;
+
+ static jni::local_ref initHybrid(
+ jni::alias_ref,
+ ComponentFactory *delegate);
+};
+
+} // namespace react
+} // namespace facebook
+```
+
+2. **Create an implementation file: `MyComponentsRegistry.cpp`**
+
+The file should be placed inside the `src/main/jni` folder alongside `MyComponentsRegistry.h
+
+```cpp title="MyComponentsRegistry.cpp"
+#include "MyComponentsRegistry.h"
+
+#include
+#include
+#include
+#include
+#include
+
+namespace facebook {
+namespace react {
+
+MyComponentsRegistry::MyComponentsRegistry(
+ ComponentFactory *delegate)
+ : delegate_(delegate) {}
+
+std::shared_ptr
+MyComponentsRegistry::sharedProviderRegistry() {
+ auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
+
+ providerRegistry->add(concreteComponentDescriptorProvider<
+ RNTMyNativeViewComponentDescriptor>());
+
+ return providerRegistry;
+}
+
+jni::local_ref
+MyComponentsRegistry::initHybrid(
+ jni::alias_ref,
+ ComponentFactory *delegate) {
+ auto instance = makeCxxInstance(delegate);
+
+ auto buildRegistryFunction =
+ [](EventDispatcher::Weak const &eventDispatcher,
+ ContextContainer::Shared const &contextContainer)
+ -> ComponentDescriptorRegistry::Shared {
+ auto registry = MyComponentsRegistry::sharedProviderRegistry()
+ ->createComponentDescriptorRegistry(
+ {eventDispatcher, contextContainer});
+
+ auto mutableRegistry =
+ std::const_pointer_cast(registry);
+
+ mutableRegistry->setFallbackComponentDescriptor(
+ std::make_shared(
+ ComponentDescriptorParameters{
+ eventDispatcher, contextContainer, nullptr}));
+
+ return registry;
+ };
+
+ delegate->buildRegistryFunction = buildRegistryFunction;
+ return instance;
+}
+
+void MyComponentsRegistry::registerNatives() {
+ registerHybrid({
+ makeNativeMethod("initHybrid", MyComponentsRegistry::initHybrid),
+ });
+}
+
+} // namespace react
+} // namespace facebook
+```
+
+4. **Load your file in the OnLoad.cpp**
+
+If you followed the TurboModule instructions, you should have a `OnLoad.cpp` file inside the `src/main/jni` folder. There you should add a line to load the `MyComponentsRegistry` class:
+
+```cpp title="OnLoad.cpp"
+#include
+#include "MyApplicationTurboModuleManagerDelegate.h"
+// Add this import
+#include "MyComponentsRegistry.h"
+
+JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
+ return facebook::jni::initialize(vm, [] {
+ facebook::react::MyApplicationTurboModuleManagerDelegate::registerNatives();
+
+ // Add this line
+ facebook::react::MyComponentsRegistry::registerNatives();
+ });
+}
+```
+
+You can now verify that everything works correctly by running your android app:
+
+```bash
+yarn react-native run-android
+```
diff --git a/website/versioned_docs/version-0.70/new-architecture-app-renderer-ios.md b/website/versioned_docs/version-0.70/new-architecture-app-renderer-ios.md
new file mode 100644
index 00000000000..39f3226f55f
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-app-renderer-ios.md
@@ -0,0 +1,93 @@
+---
+id: new-architecture-app-renderer-ios
+title: Enabling Fabric on iOS
+---
+
+import M1Cocoapods from './\_markdown-m1-cocoapods.mdx';
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+
+
+
+This section will go over how to enable the new renderer in your app. Make sure your application meets all the [prerequisites](new-architecture-app-intro).
+
+## 1. Enable Fabric in Podfile
+
+Add changes to your Podfile. You can see some examples in [RNTester](https://github.com/facebook/react-native/blob/main/packages/rn-tester/Podfile) and [rn-demo-app](https://github.com/facebook/fbt/blob/rn-demo-app/ios/Podfile).
+
+```ruby title="Podfile"
+# Add the following line at the top of Podfile.
+# Codegen produces files/classes that share names, and it will show the warning.
+# deterministic_uuids option surpresses the warning.
+install! 'cocoapods', :deterministic_uuids => false
+target 'Some App' do
+ pods()
+end
+def pods()
+ # Get config
+ config = use_native_modules!
+ # Use env variables to turn it on/off.
+ fabric_enabled = ENV['USE_FABRIC']
+ use_react_native!(
+ ...
+ # Modify here if your app root path isn't the same as this one.
+ :app_path => "#{Dir.pwd}/..",
+ # Pass the flag to enable fabric to use_react_native!.
+ :fabric_enabled => fabric_enabled
+ )
+end
+```
+
+## 2. Update your root view
+
+How to render your app with Fabric depends on your setup. Here is an example of how you can enable Fabric in your app with the `RN_FABRIC_ENABLED` compiler flag to enable/disable. Refer [RN-Tester’s AppDelegate](https://github.com/facebook/react-native/blob/main/packages/rn-tester/RNTester/AppDelegate.mm) as an example.
+
+```objc title="AppDelegate.mm"
+#ifdef RN_FABRIC_ENABLED
+#import
+#import
+#import
+#import
+#endif
+
+@interface AppDelegate () {
+#ifdef RN_FABRIC_ENABLED
+ RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
+ std::shared_ptr _reactNativeConfig;
+ facebook::react::ContextContainer::Shared _contextContainer;
+#endif
+
+ // Find a line that define rootView and replace/edit with the following lines.
+
+#ifdef RN_FABRIC_ENABLED
+ _contextContainer = std::make_shared();
+ _reactNativeConfig = std::make_shared();
+
+ _contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
+
+ _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc]
+ initWithBridge:bridge
+ contextContainer:_contextContainer];
+
+ bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
+
+ UIView *rootView =
+ [[RCTFabricSurfaceHostingProxyRootView alloc] initWithBridge:bridge
+ moduleName:<#moduleName#>
+ initialProperties:@{}];
+#else
+ // Current implementation to define rootview.
+ RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
+ moduleName:<#moduleName#>
+ initialProperties:@{}];
+#endif
+```
+
+## 3. Run pod install
+
+```bash
+// Run pod install with the flags
+USE_FABRIC=1 RCT_NEW_ARCH_ENABLED=1 pod install
+```
+
+
diff --git a/website/versioned_docs/version-0.70/new-architecture-appendix.md b/website/versioned_docs/version-0.70/new-architecture-appendix.md
new file mode 100644
index 00000000000..56b3301423b
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-appendix.md
@@ -0,0 +1,191 @@
+---
+id: new-architecture-appendix
+title: Appendix
+---
+
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+
+
+
+## I. Flow Type to Native Type Mapping
+
+You may use the following table as a reference for which types are supported and what they map to in each platform:
+
+### `string`
+
+| Nullable Support? | Android (Java) | iOS |
+| ----------------- | -------------- | ---------- |
+| `?string` | `String` | `NSString` |
+
+### `boolean`
+
+| Nullable Support? | Android (Java) | iOS |
+| ----------------- | -------------- | ---------- |
+| `?boolean` | `Boolean` | `NSNumber` |
+
+### Object literal
+
+This is recommended over using plain `Object`, for type safety.
+
+**Example:** `{| foo: string, ... |}`
+
+| Nullable Support? | Android (Java) | iOS |
+| --------------------------------------------- | -------------- | --- |
+| ?{| foo: string, ...|} | - | - |
+
+### `Object`
+
+:::note
+Recommended to use [Object literal](#object-literal) instead.
+:::
+
+| Nullable Support? | Android (Java) | iOS |
+| ----------------- | -------------- | -------------------------- |
+| `?Object` | `ReadableMap` | `@{}` (untyped dictionary) |
+
+### `Array<*>`
+
+| Nullable Support? | Android (Java) | iOS |
+| ----------------- | --------------- | -------------------------------------------------------------- |
+| `?Array<*>` | `ReadableArray` | `NSArray` (or `RCTConvertVecToArray` when used inside objects) |
+
+### `Function`
+
+| Nullable Support? | Android (Java) | iOS |
+| ----------------- | -------------- | --- |
+| `?Function` | - | - |
+
+### `Promise<*>`
+
+| Nullable Support? | Android (Java) | iOS |
+| ----------------- | ----------------------------------- | ----------------------------------------------- |
+| `?Promise<*>` | `com.facebook.react.bridge.Promise` | `RCTPromiseResolve` and `RCTPromiseRejectBlock` |
+
+### Type Unions
+
+Type unions are only supported as callbacks.
+
+**Example:** `'SUCCESS' | 'FAIL'`
+
+| Nullable Support? | Android (Java) | iOS |
+| ------------------ | -------------- | --- |
+| Only as callbacks. | - | - |
+
+### Callbacks
+
+Callback functions are not type checked, and are generalized as `Object`s.
+
+**Example:** `() =>`
+
+| Nullable Support? | Android (Java) | iOS |
+| ----------------- | ------------------------------------ | ------------------------ |
+| Yes | `com.facebook.react.bridge.Callback` | `RCTResponseSenderBlock` |
+
+:::note
+You may also find it useful to refer to the JavaScript specifications for the core modules in React Native. These are located inside the `Libraries/` directory in the React Native repository.
+:::
+
+## II. TypeScript to Native Type Mapping
+
+You may use the following table as a reference for which types are supported and what they map to in each platform:
+
+| TypeScript Type | Nullable Support? | Android (Java) | iOS | Note |
+| ---------------------------------------------- | -------------------------------------------------------- | ------------------------------------ | -------------------------------------------------------------- | ------------------------------------------------------------------------------ |
+| `string` | string | null | `String` | `NSString` | |
+| `boolean` | boolean | null | `Boolean` | `NSNumber` | |
+| `Float`, `Double`, or `Int32` | No | `double` | `NSNumber` | |
+| {| foo: string, ... |} | {| foo: string, ...|} | null | | | Object literal. This is recommended over simply using Object, for type safety. |
+| `Object` | Object | null | `ReadableMap` | `@{} (untyped dictionary)` | Recommended to use object literal (see above). |
+| `Array<*>` | Array<\*> | null | `ReadableArray` | `NSArray` (or `RCTConvertVecToArray` when used inside objects) | |
+| `Function` | Function | null | | | |
+| `Promise<*>` | Promise<\*> | null | `com.facebook.react.bridge.Promise` | `RCTPromiseResolve` and `RCTPromiseRejectBlock` | |
+| Type aliases of the above | Yes | | | |
+| Type Unions 'SUCCESS'|'FAIL' | Only as callbacks. | | | Type unions only supported as callbacks. |
+| Callbacks: `( ) =>` | Yes | `com.facebook.react.bridge.Callback` | `RCTResponseSenderBlock` | Callback functions are not type checked, and are generalized as Objects. |
+
+You may also find it useful to refer to the JavaScript specifications for the core modules in React Native. These are located inside the `Libraries/` directory in the React Native repository.
+
+## III. Invoking the code-gen during development
+
+> This section contains information specific to v0.66 of React Native.
+
+The Codegen is typically invoked at build time, but you may find it useful to generate your native interface code on demand for troubleshooting.
+
+If you wish to invoke the codegen manually, you have two options:
+
+1. Invoking a Gradle task directly (Android).
+2. Invoking a script manually.
+
+### Invoking a Gradle task directly
+
+You can trigger the Codegen by invoking the following task:
+
+```bash
+./gradlew generateCodegenArtifactsFromSchema --rerun-tasks
+```
+
+The extra `--rerun-tasks` flag is added to make sure Gradle is ignoring the `UP-TO-DATE` checks for this task. You should not need it during normal development.
+
+The `generateCodegenArtifactsFromSchema` task normally runs before the `preBuild` task, so you should not need to invoke it manually, but it will be triggered before your builds.
+
+### Invoking the script manually
+
+Alternatively, you can invoke the Codegen directly, bypassing the Gradle Plugin or CocoaPods infrastructure.
+This can be done with the following commands.
+
+The parameters to provide will look quite familiar to you now that you have already configured the Gradle plugin or CocoaPods library.
+
+#### Generating the schema file
+
+First, you’ll need to generate a schema file from your JavaScript sources. You only need to do this whenever your JavaScript specs change. The script to generate this schema is provided as part of the `react-native-codegen` package. If running this from within your React Native application, you can use the package from `node_modules` directly:
+
+```bash
+node node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js \
+
+```
+
+> The source for the `react-native-codegen` is available in the React Native repository, under `packages/react-native-codegen`. Run `yarn install` and `yarn build` in that directory to build your own `react-native-codegen` package from source. In most cases, you will not want to do this as the guide assumes the use of the `react-native-codegen` package version that is associated with the relevant React Native nightly release.
+
+#### Generating the native code artifacts
+
+Once you have a schema file for your native modules or components, you can use a second script to generate the actual native code artifacts for your library. You can use the same schema file generated by the previous script.
+
+```bash
+node node_modules/react-native/scripts/generate-specs-cli.js \
+ --platform \
+ --schemaPath \
+ --outputDir \
+ [--libraryName library_name] \
+ [--javaPackageName java_package_name] \
+ [--libraryType all(default)|modules|components]
+```
+
+> **NOTE:** The output artifacts of the Codegen are inside the build folder and should not be committed.
+> They should be considered only for reference.
+
+##### Example
+
+The following is a basic example of invoking the Codegen script to generate native iOS interface code for a library that provides native modules. The JavaScript spec sources for this library are located in a `js/` subdirectory, and this library’s native code expects the native interfaces to be available in the `ios` subdirectory.
+
+```bash
+# Generate schema - only needs to be done whenever JS specs change
+node node_modules/react-native-codegen/lib/cli/combine/combine-js-to-schema-cli.js /tmp/schema.json ./js
+
+# Generate native code artifacts
+node node_modules/react-native/scripts/generate-specs-cli.js \
+ --platform ios \
+ --schemaPath /tmp/schema.json \
+ --outputDir ./ios \
+ --libraryName MyLibSpecs \
+ --libraryType modules
+```
+
+In the above example, the code-gen script will generate several files: `MyLibSpecs.h` and `MyLibSpecs-generated.mm`, as well as a handful of `.h` and `.cpp` files, all located in the `ios` directory.
+
+## IV. Note on Existing Apps
+
+This guide provides instructions for migrating an application that is based on the default app template that is provided by React Native. If your app has deviated from the template, or you are working with an application that was never based off the template, then the following sections might help.
+
+### Finding your bridge delegate
+
+This guide assumes that the `AppDelegate` is configured as the bridge delegate. If you are not sure which is your bridge delegate, then place a breakpoint in `RCTBridge` and `RCTCxxBridge`, run your app, and inspect `self.delegate`.
diff --git a/website/versioned_docs/version-0.70/new-architecture-intro.md b/website/versioned_docs/version-0.70/new-architecture-intro.md
new file mode 100644
index 00000000000..fa88aeb9e8d
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-intro.md
@@ -0,0 +1,33 @@
+---
+id: new-architecture-intro
+title: Migrating to the New Architecture
+---
+
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+
+
+
+# Getting Started with the New Architecture
+
+This migration guide is designed for React Native **library authors** and **application developers**. It outlines the steps you need to follow to roll out the new Architecture, composed by the **new NativeModule system (TurboModule) and the new Renderer (Fabric)** to your **Android** and **iOS** libraries and apps.
+
+## Table of Contents
+
+The guide is divided into five sections:
+
+- **Supporting the New Architecture in your Library**
+ - [Prerequisites for Supporting the New Architecture in JavaScript](new-architecture-library-intro)
+ - Enabling the New Architecture in your Library
+ - [Android](new-architecture-library-android)
+ - [iOS](new-architecture-library-ios)
+- **Supporting the New Architecture in your App**
+ - [Prerequisites for Supporting the New Architecture in your App](new-architecture-app-intro)
+ - Enabling the New NativeModule System (TurboModule) in your App
+ - [Android](new-architecture-app-modules-android)
+ - [iOS](new-architecture-app-modules-ios)
+ - Enabling the New Renderer (Fabric) in your App
+ - [Android](new-architecture-app-renderer-android)
+ - [iOS](new-architecture-app-renderer-ios)
+- [**React 18 & React Native**](react-18-and-react-native)
+- [**Troubleshooting**](new-architecture-troubleshooting)
+- [**Appendix**](new-architecture-appendix)
diff --git a/website/versioned_docs/version-0.70/new-architecture-library-android.md b/website/versioned_docs/version-0.70/new-architecture-library-android.md
new file mode 100644
index 00000000000..565546a12d0
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-library-android.md
@@ -0,0 +1,117 @@
+---
+id: new-architecture-library-android
+title: Enabling in Android Library
+---
+
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
+
+
+
+Once you have defined the JavaScript specs for your native modules as part of the [prerequisites](new-architecture-library-intro), setup the configuration of the Codegen, and followed the Android/Gradle setup, you are now ready to migrate your library to the new architecture. Here are the steps you can follow to accomplish this.
+
+## 1. Extend or implement the code-generated native interfaces
+
+The JavaScript spec for your native module or component will be used to generate native interface code for each supported platform (i.e. Android and iOS). These native interface files will be generated **when a React Native application that depends on your library is built**.
+
+While this generated native interface code **will not ship as part of your library**, you do need to make sure your Java/Kotlin code conforms to the protocols provided by these native interface files.
+
+You can invoke the `generateCodegenArtifactsFromSchema` Gradle task to generate your library’s native interface code in order to use them **as a reference:**
+
+```bash
+./gradlew generateCodegenArtifactsFromSchema
+```
+
+The files that are output can be found inside `build/generated/source/codegen` and **should not be committed**, but you’ll need to refer to them to determine what changes you need to make to your native modules in order for them to provide an implementation for each generated interface.
+
+The output of the codegen for a module called `NativeAwesomeManager` will look like this:
+
+```
+app/build/generated/source/codegen
+├── java
+│ └── com
+│ └── example
+│ └── samplelibrary
+│ └── NativeAwesomeManagerSpec.java
+├── jni
+│ ├── Android.mk
+│ ├── react
+│ │ └── renderer
+│ │ └── components
+│ │ └── samplelibrary
+│ │ ├── ComponentDescriptors.h
+│ │ ├── EventEmitters.cpp
+│ │ ├── EventEmitters.h
+│ │ ├── Props.cpp
+│ │ ├── Props.h
+│ │ ├── ShadowNodes.cpp
+│ │ └── ShadowNodes.h
+│ ├── samplelibrary-generated.cpp
+│ └── samplelibrary.h
+└── schema.json
+```
+
+### Extends the abstract class provided by the codegen
+
+Update your native module or component to ensure it **extends the abstract class** that has been code-generated from your JavaScript specs (i.e. the `NativeAwesomeManagerSpec.java` file from the previous example).
+
+Following the example set forth in the previous section, your library might import `NativeAwesomeManagerSpec`, implement the relevant native interface and the necessary methods for it:
+
+
+
+
+
+```java
+import androidx.annotation.NonNull;
+
+import com.example.samplelibrary.NativeAwesomeManagerSpec;
+import com.facebook.react.bridge.Promise;
+import com.facebook.react.bridge.ReactApplicationContext;
+
+public class NativeAwesomeManager extends NativeAwesomeManagerSpec {
+
+ public static final String NAME = "NativeAwesomeManager";
+
+ public NativeAwesomeManager(ReactApplicationContext reactContext) {
+ super(reactContext);
+ }
+
+ @Override
+ public void getString(String id, Promise promise) {
+ // Implement this method
+ }
+
+ @NonNull
+ @Override
+ public String getName() {
+ return NAME;
+ }
+}
+```
+
+
+
+
+
+```kotlin
+import com.example.samplelibrary.NativeAwesomeManagerSpec
+import com.facebook.react.bridge.Promise
+import com.facebook.react.bridge.ReactApplicationContext
+
+class NativeAwesomeManager(reactContext: ReactApplicationContext) :
+ NativeAwesomeManagerSpec(reactContext) {
+ override fun getString(id: String, promise: Promise) {
+ // Implement this method
+ }
+
+ override fun getName() = NAME
+
+ companion object {
+ val NAME = "NativeAwesomeManager"
+ }
+}
+```
+
+
+
+
+Please note that the **generated abstract class** that you’re now extending (`MyAwesomeSpec` in this example), is itself extending `ReactContextBaseJavaModule`. Therefore you should not use access to any of the method/fields you were previously using (e.g. the `ReactApplicationContext` and so on). Moreover the generated class will now also implement the `TurboModule` interface for you.
diff --git a/website/versioned_docs/version-0.70/new-architecture-library-intro.md b/website/versioned_docs/version-0.70/new-architecture-library-intro.md
new file mode 100644
index 00000000000..fab1bbe4bb6
--- /dev/null
+++ b/website/versioned_docs/version-0.70/new-architecture-library-intro.md
@@ -0,0 +1,676 @@
+---
+id: new-architecture-library-intro
+title: Prerequisites for Libraries
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import constants from '@site/core/TabsConstants';
+import NewArchitectureWarning from './\_markdown-new-architecture-warning.mdx';
+
+
+
+The following steps will help ensure your modules and components are ready for the New Architecture.
+
+## Define Specs in JavaScript
+
+The JavaScript specs serve as the source of truth for the methods that are provided by each native module. They defines all APIs that are provided by the native module, along with the types of those constants and functions.
+Using a **typed** spec file allows to be intentional and declare all the input arguments and outputs of your native module’s methods.
+
+:::info
+Currently, this guide is written under the assumption that you will be using [Flow](https://flow.org/). The `react-native-codegen` package is also currently working only with Flow source as input. **TypeScript** support is in beta right now.
+:::
+
+To adopt the New Architecture, you start by creating these specs for your native modules and native components. You can do this prior to actually migrating to the New Architecture: the specs will be used later on to generate native interface code for all the supported platforms, as a way to enforce uniform APIs across platforms.
+
+#### Turbomodules
+
+JavaScript spec files **must** be named `Native.js` and they export a `TurboModuleRegistry` `Spec` object. The name convention is important because the Codegen process looks for modules whose `js` (`jsx`, `ts`, or `tsx`) spec file starts with the keyword `Native`.
+
+The following is a basic JavaScript spec template, written using the [Flow](https://flow.org/) syntax as well as [TypeScript](https://www.typescriptlang.org/).
+
+
+
+
+```ts
+// @flow
+
+import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
+import {TurboModuleRegistry} from 'react-native';
+
+export interface Spec extends TurboModule {
+ +getConstants: () => {||};
+
+ // your module methods go here, for example:
+ getString(id: string): Promise;
+}
+
+export default (TurboModuleRegistry.get(''): ?Spec);
+```
+
+
+
+
+```ts
+import type { TurboModule } from 'react-native';
+import { TurboModuleRegistry } from 'react-native';
+
+export interface Spec extends TurboModule {
+ readonly getConstants: () => {};
+
+ // your module methods go here, for example:
+ getString(id: string): Promise;
+}
+
+export default TurboModuleRegistry.get('');
+```
+
+
+
+
+#### Fabric Components
+
+JavaScript spec files **must** be named `NativeComponent.js` (for TypeScript use extension `.ts` or `.tsx`) and they export a `HostComponent` object. The name convention is important: the Codegen process looks for components whose spec file (either JavaScript or TypeScript) ends with the suffix `NativeComponent`.
+
+The following snippet shows a basic JavaScript spec template, written in [Flow](https://flow.org/) as well as [TypeScript](https://www.typescriptlang.org/).
+
+
+
+
+```ts
+// @flow strict-local
+
+import type {ViewProps} from 'react-native/Libraries/Components/View/ViewPropTypes';
+import type {HostComponent} from 'react-native';
+import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
+
+type NativeProps = $ReadOnly<{|
+ ...ViewProps,
+ // add other props here
+|}>;
+
+export default (codegenNativeComponent(
+ '',
+): HostComponent);
+```
+
+
+
+
+```ts
+import type { ViewProps } from 'ViewPropTypes';
+import type { HostComponent } from 'react-native';
+import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
+
+export interface NativeProps extends ViewProps {
+ // add other props here
+}
+
+export default codegenNativeComponent(
+ ''
+) as HostComponent;
+```
+
+
+
+
+### Supported Types
+
+When using Flow or TypeScript, you will be using [type annotations](https://flow.org/en/docs/types/) to define your spec. Keeping in mind that the goal of defining a JavaScript spec is to ensure the generated native interface code is type safe, the set of supported types will be those that can be mapped one-to-one to a corresponding type on the native platform.
+
+
+
+In general, this means you can use primitive types (strings, numbers, booleans), as well as function types, object types, and array types. Union types, on the other hand, are not supported. All types must be read-only. For Flow: either `+` or `$ReadOnly<>` or `{||}` objects. For TypeScript: `readonly` for properties, `Readonly<>` for objects, and `ReadonlyArray<>` for arrays.
+
+> See Appendix [I. Flow Type to Native Type Mapping](#i-flow-type-to-native-type-mapping).
+> See Appendix [II. TypeScript to Native Type Mapping](#ii-typescript-to-native-type-mapping).
+
+### Codegen helper types
+
+You can use predefined types for your JavaScript spec, here is a list of them:
+
+- `Double`
+- `Float`
+- `Int32`
+- `WithDefault` - Sets default value for type
+- `BubblingEventHandler` - For bubbling events (eg: `onChange`).
+- `DirectEventHandler` - For direct events (eg: `onClick`).
+
+Later on those types are compiled to coresponding equivalents on target platforms.
+
+### Be Consistent Across Platforms and Eliminate Type Ambiguity
+
+Before adopting the New Architecture in your native module, you will need to ensure your methods are consistent across platforms. This is something you will realize as you set out to write the JavaScript spec for your native module - remember, that JavaScript spec defines what the methods will look like on all supported platforms.
+
+If your existing native module has methods with the same name on multiple platforms, but with different numbers or types of arguments across platforms, you will need to find a way to make these consistent. If you have methods that can take two or more different types for the same argument, you will also need to find a way to resolve this type ambiguity as type unions are intentionally not supported.
+
+## Make sure _autolinking_ is enabled
+
+
+
+[Autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) is a feature of the React Native CLI that simplifies the installation of third-party React Native libraries. Instructions to enable _autolinking_ are available at https://github.com/react-native-community/cli/blob/master/docs/autolinking.md.
+
+### Android
+
+On Android, this generally requires you to include `native_modules.gradle` in both your `settings.gradle[.kts]` and `build.gradle[.kts]`.
+
+If you used the default template provided with React Native (i.e. you used `yarn react-native init `), then you have autolinking already enabled.
+
+You can anyway verify that you have it enabled with:
+
+```bash
+$ grep -r "native_modules.gradle" android
+
+android/app/build.gradle:apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
+android/settings.gradle:apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
+...
+```
+
+If you don't, open the `settings.gradle` file and add this line:
+
+```diff
+rootProject.name =
++ apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
+```
+
+Then, open your `android/app/build.gradle` file and add this line at the end of the file:
+
+```kotlin
+apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
+```
+
+### iOS
+
+On iOS, make sure that your library provides a Podspec (see [`react-native-webview`](https://github.com/react-native-community/react-native-webview/blob/master/react-native-webview.podspec) for an example).
+
+:::info
+
+To determine if your library is set up for autolinking, check the CocoaPods output after running `pod install` (or `arch -x86_64 pod install` in case of a Mac M1) on an iOS project. If you see "auto linking library name", you are all set to go.
+
+:::
+
+## Configure Codegen
+
+[Codegen](the-new-architecture/pillars-codegen) is a tool that runs when you build an Android app or when you install the dependencies of an iOS app. It creates some scaffolding code that you won't have to create manually.
+
+Codegen can be configured in the `package.json` file of your Library. Add the following JSON object at the end of it.
+
+```diff
+ },
++ "codegenConfig": {
++ "name": "",
++ "type": "all",
++ "jsSrcsDir": ".",
++ "android": {
++ "javaPackageName": "com.facebook.fbreact.specs"
++ }
++ }
+}
+```
+
+- The `codegenConfig` is the key used by the Codegen to verify that there is some code to generate.
+- The `name` field, is the name of the library.
+- The `type` field is used to identify the type of module we want to create. Our suggestions is to keep `all` to support libraries that contains both TurboModule and Fabric Components.
+- The `jsSrcsDir` is the directory where the codegen will start looking for JavaScript specs.
+- The `android.javaPackageName` is the name of the package where the generated code wil end up.
+
+Android also requires to have the [React Gradle Plugin properly configured](new-architecture-app-intro#android-specifics) in your app.
+
+## Preparing your JavaScript codebase for the new React Native Renderer (Fabric)
+
+The new renderer also known as Fabric doesn’t use the UIManager so direct calls to UIManager will need to be migrated. Historically, calls to UIManager had some pretty complicated patterns. Fortunately, we’ve created new APIs that are much cleaner. These new APIs are forwards compatible with Fabric so you can migrate your code today and they will work properly when you turn on Fabric!
+
+Fabric will be providing new type safe JS APIs that are much more ergonomic than some of the patterns we've seen in product code today. These APIs require references to the underlying component, no longer using the result of `findNodeHandle`. `findNodeHandle` is used to search the tree for a native component given a class instance. This was breaking the React abstraction model. `findNodeHandle` is not compatible with React 18. Deprecation of `findNodeHandle` in React Native is similar to the [deprecation of `findDOMNode` in React DOM](https://reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage).
+
+While we know that all deprecations are a hassle, this guide is intended to help people update components as smoothly as possible. Here are the steps you need to take to get your JS codebase ready for Fabric:
+
+1. Migrating findNodeHandle / getting a HostComponent
+2. Migrating `.measure*()`
+3. Migrating off `setNativeProps`
+4. Move the call to `requireNativeComponent` to a separate file
+5. Migrating off `dispatchViewManagerCommand`
+6. Creating NativeCommands with `codegenNativeCommands`
+
+### Migrating `findNodeHandle` / getting a `HostComponent`
+
+Much of the migration work requires a HostComponent ref to access certain APIs that are only attached to host components (like View, Text, or ScrollView). HostComponents are the return value of calls to `requireNativeComponent`. `findNodeHandle` tunnels through multiple levels of component hierarchy to find the nearest native component.
+
+As a concrete example, this code uses `findNodeHandle` to tunnel from `ParentComponent` through to the `View` rendered by `ChildComponent`.
+
+```jsx
+class ParentComponent extends React.Component {
+ _ref: ?React.ElementRef;
+
+ render() {
+ return
+ }
+
+ _captureRef: (ref) => {
+ this._ref = ref;
+ }
+
+ _onSubmit: () => {
+ const nodeHandle = findNodeHandle(this._ref);
+
+ if (nodeHandle) {
+ UIManager.measure(nodeHandle, () => {});
+ }
+ }
+}
+
+class ChildComponent extends React.Component {
+ render() {
+ return (
+
+
+
+ );
+ }
+}
+```
+
+We can’t convert this call to `this._ref.measure` because `this._ref` is an instance to `ChildComponent`, which is not a HostComponent and thus does not have a `measure` function.
+
+`ChildComponent` renders a `View`, which is a HostComponent, so we need to get a reference to `View` instead. There are typically two approaches to get what we need. If the component we need to get the ref from is a function component using `forwardRef` is probably the right choice. If it is a class component with other public methods, adding a public method for getting the ref is an option. Here are examples of those two forms:
+
+### Using `forwardRef`
+
+```jsx
+class ParentComponent extends React.Component {
+ _ref: ?React.ElementRef;
+
+ render() {
+ return
+ }
+
+ _captureRef: (ref) => {
+ this._ref = ref;
+ }
+
+ _onSubmit: () => {
+ if (this._ref != null)
+ this._ref.measure(() => {});
+ }
+ }
+}
+
+const ChildComponent = React.forwardRef((props, forwardedRef) => {
+ return (
+
+
+
+ );
+});
+```
+
+### Using a getter, (note the addition of `getViewRef`)
+
+```tsx
+class ParentComponent extends React.Component {
+ _ref: ?React.ElementRef;
+
+ render() {
+ return
+ }
+
+ _captureRef: (ref) => {
+ this._ref = ref;
+ }
+
+ _onSubmit: () => {
+ if (this._ref != null)
+ this._ref.getViewRef().measure(() => {});
+ }
+ }
+}
+
+class ChildComponent extends React.Component {
+ _ref: ?React.ElementRef;
+
+ render() {
+ return (
+
+
+
+ );
+ }
+
+ getViewRef(): ?React.ElementRef {
+ return this._ref;
+ }
+
+ _captureRef: (ref) => {
+ this._ref = ref;
+ }
+}
+```
+
+### Migrating `.measure*()`
+
+Let’s take a look at an example calling `UIManager.measure`. This code might look something like this
+
+```js
+const viewRef: React.ElementRef = /* ... */;
+const viewHandle = ReactNative.findNodeHandle(viewRef);
+
+UIManager.measure(viewHandle, (x, y, width, height) => {
+ // Use layout metrics.
+});
+```
+
+In order to call `UIManager.measure*` we need to call `findNodeHandle` first and pass in those handles. With the new API, we instead call `measure` directly on native refs without `findNodeHandle`. The example above with the new API looks like this:
+
+```js
+const viewRef: React.ElementRef = /* ... */;
+
+viewRef.measure((x, y, width, height) => {
+ // Use layout metrics.
+});
+```
+
+`findNodeHandle` can be called with any component as an argument, but the new `.measure*` can only be called on native refs. If the ref originally passed into `findNodeHandle` is not a native ref to start with, use the strategies above in _getting a HostComponent_ to find the native ref.
+
+### Migrating off `setNativeProps`
+
+`setNativeProps` will not be supported in the post-Fabric world. To migrate, move all `setNativeProp` values to component state.
+
+**Example**
+
+```ts
+class MyComponent extends React.Component {
+ _viewRef: ?React.ElementRef;
+
+ render() {
+ const {somePropValue} = this.props;
+ return
+ }
+
+ _captureRef: (ref) => {
+ this._viewRef = ref;
+ }
+
+ _onSubmit: () => {
+ this._viewRef.setNativeProps({
+ style: styles.submittedView,
+ accessibility: true
+ });
+ // ...other logic for onSubmit
+ }
+}
+
+const styles = StyleSheet.create({
+ view: { backgroundColor: 'white'},
+ submittedView: {borderWidth: 1}
+});
+```
+
+In this example when the View is pressed there is a `setNativeProps` call to update the style and accessibility props of the component. To migrate this component it’s important to understand its current behavior using `setNativeProps`.
+
+### Pre-Fabric, Component Props Persist
+
+On first render, the component props are those declared in the render function. After the View is pressed `_onSubmit` calls `setNativeProps` with updated prop values.
+The resulting component can be represented as such:
+
+```jsx
+
+```
+
+Note that all prop values set in the render function are unchanged even though `setNativeProps` didn’t pass those props. Also, `style` is now the merged value of its value prior to `_onSubmit` and `styles.submittedView`. This is the important takeaway: in our current pre-Fabric world, **component props persist.** The platform view caches the prop values its passed from the JS side. If this wasn’t the case then following the setNativeProps call, React Native would have rendered a component like this:
+
+```jsx
+
+```
+
+The fact that React Native stores some internal state of each component that isn’t explicitly declared in last render is what Fabric intends to fix.
+
+### Moving `setNativeProps` to state
+
+Taking those caveats into account, a proper migration would look like this:
+
+```tsx
+class MyComponent extends React.Component {
+ state = {
+ hasSubmitted: false,
+ accessibility: false
+ };
+
+ render() {
+ const {somePropValue} = this.props;
+ const submittedStyle = this.state.hasSubmitted ? styles.submittedView: null;
+ return
+ }
+
+ _onSubmit: () => {
+ this.setState(state => ({ ...state, hasSubmitted: true }));
+ // ...other logic for onSubmit
+ }
+}
+
+
+const styles = StyleSheet.create({
+ view: { backgroundColor: 'white'},
+ submittedView: {borderWidth: 1}
+});
+```
+
+- We are using the `hasSubmitted` flag to represent whether or not we want to apply `styles.submittedView`. If the style was dynamic then it makes sense to store the style object in state
+- `accessibility` is now explicitly passed to the View component as a boolean. This differs from the prior implementation where `accessibility` wasn’t passed as a prop in initial render but in this case we know the non-specification of `accessibility` is handled in the same way as `accessibilty={false}`
+
+Be wary of your assumptions as uncaught subtleties can introduce differences in behavior! It’s a good idea to have snapshot tests of your component as they will highlight any differences pre and post your migration.
+
+### Move the call to `requireNativeComponent` to a separate file
+
+This will prepare for the JS to be ready for the new codegen system for the New Architecture. The new file should be named `NativeComponent.js.`
+
+#### Old way
+
+```js
+const RNTMyNativeView = requireNativeComponent('RNTMyNativeView');
+
+[...]
+
+return ;
+```
+
+#### New way
+
+```js title="RNTMyNativeNativeComponent.js"
+import RNTMyNativeViewNativeComponent from './RNTMyNativeViewNativeComponent';
+
+[...]
+
+return ;
+```
+
+```js title="RNTMyNativeViewNativeComponent.js"
+import { requireNativeComponent } from 'react-native';
+
+const RNTMyNativeViewNativeComponent = requireNativeComponent(
+ 'RNTMyNativeView'
+);
+
+export default RNTMyNativeViewNativeComponent;
+```
+
+#### Flow support
+
+If `requireNativeComponent` is not typed, you can temporarily use the `mixed` type to fix the Flow warning, for example:
+
+```js
+import type { HostComponent } from 'react-native/Libraries/Renderer/shims/ReactNativeTypes';
+// ...
+const RCTWebViewNativeComponent: HostComponent =
+ requireNativeComponent < mixed > 'RNTMyNativeView';
+```
+
+#### Later on you can replace `requireNativeComponent`
+
+When you are ready to migrate to Fabric you can replace `requireNativeComponent` with `codegenNativeComponent`:
+
+```ts title="RNTMyNativeViewNativeComponent.js"
+export default (codegenNativeComponent(
+ 'RNTMyNativeView',
+): HostComponent