diff --git a/docs/the-new-architecture/pure-cxx-modules.md b/docs/the-new-architecture/pure-cxx-modules.md index 166e2a4a940..0a1875e9d1c 100644 --- a/docs/the-new-architecture/pure-cxx-modules.md +++ b/docs/the-new-architecture/pure-cxx-modules.md @@ -1,3 +1,6 @@ +import {getCurrentVersion} from '@site/src/getCurrentVersion'; +import CodeBlock from '@theme/CodeBlock'; + # Cross-Platform Native Modules (C++) import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; @@ -14,9 +17,9 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module The rest of this guide assume that you have created your application running the command: -```shell -npx @react-native-community/cli@latest init SampleApp --version 0.80.0 -``` + +{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`} + ## 1. Create the JS specs @@ -224,9 +227,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so 1. From the folder `SampleApp/android/app/src/main/jni`, run the following command: -```sh -curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp -``` + +{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`} + 2. Then, modify this file as follows: diff --git a/website/versioned_docs/version-0.77/the-new-architecture/pure-cxx-modules.md b/website/versioned_docs/version-0.77/the-new-architecture/pure-cxx-modules.md index dcc72097dc9..260e5f871fa 100644 --- a/website/versioned_docs/version-0.77/the-new-architecture/pure-cxx-modules.md +++ b/website/versioned_docs/version-0.77/the-new-architecture/pure-cxx-modules.md @@ -1,7 +1,9 @@ -# Cross-Platform Native Modules (C++) - +import {getCurrentVersion} from '@site/src/getCurrentVersion'; +import CodeBlock from '@theme/CodeBlock'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; +# Cross-Platform Native Modules (C++) + Writing a module in C++ is the best way to share platform-agnostic code between Android and iOS. With pure C++ modules, you can write your logic only once and reuse it right away from all the platforms, without the need of writing platform-specific code. In this guide, we will go through the creation of a pure C++ Turbo Native Module: @@ -14,9 +16,9 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module The rest of this guide assume that you have created your application running the command: -```shell -npx @react-native-community/cli@latest init SampleApp --version 0.77.0 -``` + +{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`} + ## 1. Create the JS specs @@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so 1. From the folder `SampleApp/android/app/src/main/jni`, run the following command: -```sh -curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp -``` + +{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`} + 2. Then, modify this file as follows: diff --git a/website/versioned_docs/version-0.78/the-new-architecture/pure-cxx-modules.md b/website/versioned_docs/version-0.78/the-new-architecture/pure-cxx-modules.md index f134e3fc0c4..260e5f871fa 100644 --- a/website/versioned_docs/version-0.78/the-new-architecture/pure-cxx-modules.md +++ b/website/versioned_docs/version-0.78/the-new-architecture/pure-cxx-modules.md @@ -1,7 +1,9 @@ -# Cross-Platform Native Modules (C++) - +import {getCurrentVersion} from '@site/src/getCurrentVersion'; +import CodeBlock from '@theme/CodeBlock'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; +# Cross-Platform Native Modules (C++) + Writing a module in C++ is the best way to share platform-agnostic code between Android and iOS. With pure C++ modules, you can write your logic only once and reuse it right away from all the platforms, without the need of writing platform-specific code. In this guide, we will go through the creation of a pure C++ Turbo Native Module: @@ -14,9 +16,9 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module The rest of this guide assume that you have created your application running the command: -```shell -npx @react-native-community/cli@latest init SampleApp --version 0.78.0 -``` + +{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`} + ## 1. Create the JS specs @@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so 1. From the folder `SampleApp/android/app/src/main/jni`, run the following command: -```sh -curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp -``` + +{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`} + 2. Then, modify this file as follows: diff --git a/website/versioned_docs/version-0.79/the-new-architecture/pure-cxx-modules.md b/website/versioned_docs/version-0.79/the-new-architecture/pure-cxx-modules.md index c37c92d22e6..018f427c6e2 100644 --- a/website/versioned_docs/version-0.79/the-new-architecture/pure-cxx-modules.md +++ b/website/versioned_docs/version-0.79/the-new-architecture/pure-cxx-modules.md @@ -1,7 +1,9 @@ -# Cross-Platform Native Modules (C++) - +import {getCurrentVersion} from '@site/src/getCurrentVersion'; +import CodeBlock from '@theme/CodeBlock'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; +# Cross-Platform Native Modules (C++) + Writing a module in C++ is the best way to share platform-agnostic code between Android and iOS. With pure C++ modules, you can write your logic only once and reuse it right away from all the platforms, without the need of writing platform-specific code. In this guide, we will go through the creation of a pure C++ Turbo Native Module: @@ -14,9 +16,9 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module The rest of this guide assume that you have created your application running the command: -```shell -npx @react-native-community/cli@latest init SampleApp --version 0.79.0 -``` + +{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`} + ## 1. Create the JS specs @@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so 1. From the folder `SampleApp/android/app/src/main/jni`, run the following command: -```sh -curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp -``` + +{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`} + 2. Then, modify this file as follows: diff --git a/website/versioned_docs/version-0.80/the-new-architecture/pure-cxx-modules.md b/website/versioned_docs/version-0.80/the-new-architecture/pure-cxx-modules.md index 166e2a4a940..018f427c6e2 100644 --- a/website/versioned_docs/version-0.80/the-new-architecture/pure-cxx-modules.md +++ b/website/versioned_docs/version-0.80/the-new-architecture/pure-cxx-modules.md @@ -1,7 +1,9 @@ -# Cross-Platform Native Modules (C++) - +import {getCurrentVersion} from '@site/src/getCurrentVersion'; +import CodeBlock from '@theme/CodeBlock'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; +# Cross-Platform Native Modules (C++) + Writing a module in C++ is the best way to share platform-agnostic code between Android and iOS. With pure C++ modules, you can write your logic only once and reuse it right away from all the platforms, without the need of writing platform-specific code. In this guide, we will go through the creation of a pure C++ Turbo Native Module: @@ -14,9 +16,9 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module The rest of this guide assume that you have created your application running the command: -```shell -npx @react-native-community/cli@latest init SampleApp --version 0.80.0 -``` + +{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`} + ## 1. Create the JS specs @@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so 1. From the folder `SampleApp/android/app/src/main/jni`, run the following command: -```sh -curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp -``` + +{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`} + 2. Then, modify this file as follows: diff --git a/website/versioned_docs/version-0.81/the-new-architecture/pure-cxx-modules.md b/website/versioned_docs/version-0.81/the-new-architecture/pure-cxx-modules.md index 166e2a4a940..018f427c6e2 100644 --- a/website/versioned_docs/version-0.81/the-new-architecture/pure-cxx-modules.md +++ b/website/versioned_docs/version-0.81/the-new-architecture/pure-cxx-modules.md @@ -1,7 +1,9 @@ -# Cross-Platform Native Modules (C++) - +import {getCurrentVersion} from '@site/src/getCurrentVersion'; +import CodeBlock from '@theme/CodeBlock'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; +# Cross-Platform Native Modules (C++) + Writing a module in C++ is the best way to share platform-agnostic code between Android and iOS. With pure C++ modules, you can write your logic only once and reuse it right away from all the platforms, without the need of writing platform-specific code. In this guide, we will go through the creation of a pure C++ Turbo Native Module: @@ -14,9 +16,9 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module The rest of this guide assume that you have created your application running the command: -```shell -npx @react-native-community/cli@latest init SampleApp --version 0.80.0 -``` + +{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`} + ## 1. Create the JS specs @@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so 1. From the folder `SampleApp/android/app/src/main/jni`, run the following command: -```sh -curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp -``` + +{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`} + 2. Then, modify this file as follows: diff --git a/website/versioned_docs/version-0.82/the-new-architecture/pure-cxx-modules.md b/website/versioned_docs/version-0.82/the-new-architecture/pure-cxx-modules.md index 166e2a4a940..018f427c6e2 100644 --- a/website/versioned_docs/version-0.82/the-new-architecture/pure-cxx-modules.md +++ b/website/versioned_docs/version-0.82/the-new-architecture/pure-cxx-modules.md @@ -1,7 +1,9 @@ -# Cross-Platform Native Modules (C++) - +import {getCurrentVersion} from '@site/src/getCurrentVersion'; +import CodeBlock from '@theme/CodeBlock'; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants'; +# Cross-Platform Native Modules (C++) + Writing a module in C++ is the best way to share platform-agnostic code between Android and iOS. With pure C++ modules, you can write your logic only once and reuse it right away from all the platforms, without the need of writing platform-specific code. In this guide, we will go through the creation of a pure C++ Turbo Native Module: @@ -14,9 +16,9 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module The rest of this guide assume that you have created your application running the command: -```shell -npx @react-native-community/cli@latest init SampleApp --version 0.80.0 -``` + +{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`} + ## 1. Create the JS specs @@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so 1. From the folder `SampleApp/android/app/src/main/jni`, run the following command: -```sh -curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp -``` + +{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`} + 2. Then, modify this file as follows: