Skip to content

Commit 3597409

Browse files
Native Modules: Update React Native version references (#4882)
1 parent 5b3e823 commit 3597409

7 files changed

Lines changed: 69 additions & 54 deletions

File tree

docs/the-new-architecture/pure-cxx-modules.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import {getCurrentVersion} from '@site/src/getCurrentVersion';
2+
import CodeBlock from '@theme/CodeBlock';
3+
14
# Cross-Platform Native Modules (C++)
25

36
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
1417

1518
The rest of this guide assume that you have created your application running the command:
1619

17-
```shell
18-
npx @react-native-community/cli@latest init SampleApp --version 0.80.0
19-
```
20+
<CodeBlock language="bash" title="shell">
21+
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
22+
</CodeBlock>
2023

2124
## 1. Create the JS specs
2225

@@ -224,9 +227,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so
224227

225228
1. From the folder `SampleApp/android/app/src/main/jni`, run the following command:
226229

227-
```sh
228-
curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
229-
```
230+
<CodeBlock language="sh" title="shell">
231+
{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`}
232+
</CodeBlock>
230233

231234
2. Then, modify this file as follows:
232235

website/versioned_docs/version-0.77/the-new-architecture/pure-cxx-modules.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Cross-Platform Native Modules (C++)
2-
1+
import {getCurrentVersion} from '@site/src/getCurrentVersion';
2+
import CodeBlock from '@theme/CodeBlock';
33
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
44

5+
# Cross-Platform Native Modules (C++)
6+
57
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.
68

79
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
1416

1517
The rest of this guide assume that you have created your application running the command:
1618

17-
```shell
18-
npx @react-native-community/cli@latest init SampleApp --version 0.77.0
19-
```
19+
<CodeBlock language="bash" title="shell">
20+
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
21+
</CodeBlock>
2022

2123
## 1. Create the JS specs
2224

@@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so
224226

225227
1. From the folder `SampleApp/android/app/src/main/jni`, run the following command:
226228

227-
```sh
228-
curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
229-
```
229+
<CodeBlock language="sh" title="shell">
230+
{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`}
231+
</CodeBlock>
230232

231233
2. Then, modify this file as follows:
232234

website/versioned_docs/version-0.78/the-new-architecture/pure-cxx-modules.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Cross-Platform Native Modules (C++)
2-
1+
import {getCurrentVersion} from '@site/src/getCurrentVersion';
2+
import CodeBlock from '@theme/CodeBlock';
33
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
44

5+
# Cross-Platform Native Modules (C++)
6+
57
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.
68

79
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
1416

1517
The rest of this guide assume that you have created your application running the command:
1618

17-
```shell
18-
npx @react-native-community/cli@latest init SampleApp --version 0.78.0
19-
```
19+
<CodeBlock language="bash" title="shell">
20+
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
21+
</CodeBlock>
2022

2123
## 1. Create the JS specs
2224

@@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so
224226

225227
1. From the folder `SampleApp/android/app/src/main/jni`, run the following command:
226228

227-
```sh
228-
curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
229-
```
229+
<CodeBlock language="sh" title="shell">
230+
{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`}
231+
</CodeBlock>
230232

231233
2. Then, modify this file as follows:
232234

website/versioned_docs/version-0.79/the-new-architecture/pure-cxx-modules.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Cross-Platform Native Modules (C++)
2-
1+
import {getCurrentVersion} from '@site/src/getCurrentVersion';
2+
import CodeBlock from '@theme/CodeBlock';
33
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
44

5+
# Cross-Platform Native Modules (C++)
6+
57
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.
68

79
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
1416

1517
The rest of this guide assume that you have created your application running the command:
1618

17-
```shell
18-
npx @react-native-community/cli@latest init SampleApp --version 0.79.0
19-
```
19+
<CodeBlock language="bash" title="shell">
20+
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
21+
</CodeBlock>
2022

2123
## 1. Create the JS specs
2224

@@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so
224226

225227
1. From the folder `SampleApp/android/app/src/main/jni`, run the following command:
226228

227-
```sh
228-
curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
229-
```
229+
<CodeBlock language="sh" title="shell">
230+
{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`}
231+
</CodeBlock>
230232

231233
2. Then, modify this file as follows:
232234

website/versioned_docs/version-0.80/the-new-architecture/pure-cxx-modules.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Cross-Platform Native Modules (C++)
2-
1+
import {getCurrentVersion} from '@site/src/getCurrentVersion';
2+
import CodeBlock from '@theme/CodeBlock';
33
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
44

5+
# Cross-Platform Native Modules (C++)
6+
57
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.
68

79
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
1416

1517
The rest of this guide assume that you have created your application running the command:
1618

17-
```shell
18-
npx @react-native-community/cli@latest init SampleApp --version 0.80.0
19-
```
19+
<CodeBlock language="bash" title="shell">
20+
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
21+
</CodeBlock>
2022

2123
## 1. Create the JS specs
2224

@@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so
224226

225227
1. From the folder `SampleApp/android/app/src/main/jni`, run the following command:
226228

227-
```sh
228-
curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
229-
```
229+
<CodeBlock language="sh" title="shell">
230+
{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`}
231+
</CodeBlock>
230232

231233
2. Then, modify this file as follows:
232234

website/versioned_docs/version-0.81/the-new-architecture/pure-cxx-modules.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Cross-Platform Native Modules (C++)
2-
1+
import {getCurrentVersion} from '@site/src/getCurrentVersion';
2+
import CodeBlock from '@theme/CodeBlock';
33
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
44

5+
# Cross-Platform Native Modules (C++)
6+
57
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.
68

79
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
1416

1517
The rest of this guide assume that you have created your application running the command:
1618

17-
```shell
18-
npx @react-native-community/cli@latest init SampleApp --version 0.80.0
19-
```
19+
<CodeBlock language="bash" title="shell">
20+
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
21+
</CodeBlock>
2022

2123
## 1. Create the JS specs
2224

@@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so
224226

225227
1. From the folder `SampleApp/android/app/src/main/jni`, run the following command:
226228

227-
```sh
228-
curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
229-
```
229+
<CodeBlock language="sh" title="shell">
230+
{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`}
231+
</CodeBlock>
230232

231233
2. Then, modify this file as follows:
232234

website/versioned_docs/version-0.82/the-new-architecture/pure-cxx-modules.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# Cross-Platform Native Modules (C++)
2-
1+
import {getCurrentVersion} from '@site/src/getCurrentVersion';
2+
import CodeBlock from '@theme/CodeBlock';
33
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; import constants from '@site/core/TabsConstants';
44

5+
# Cross-Platform Native Modules (C++)
6+
57
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.
68

79
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
1416

1517
The rest of this guide assume that you have created your application running the command:
1618

17-
```shell
18-
npx @react-native-community/cli@latest init SampleApp --version 0.80.0
19-
```
19+
<CodeBlock language="bash" title="shell">
20+
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
21+
</CodeBlock>
2022

2123
## 1. Create the JS specs
2224

@@ -224,9 +226,9 @@ The final step is to register the new C++ Turbo Native Module in the runtime, so
224226

225227
1. From the folder `SampleApp/android/app/src/main/jni`, run the following command:
226228

227-
```sh
228-
curl -O https://raw.githubusercontent.com/facebook/react-native/v0.76.0/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
229-
```
229+
<CodeBlock language="sh" title="shell">
230+
{`curl -O https://raw.githubusercontent.com/facebook/react-native/${getCurrentVersion() === 'latest' ? '' : 'v'}${getCurrentVersion()}/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp`}
231+
</CodeBlock>
230232

231233
2. Then, modify this file as follows:
232234

0 commit comments

Comments
 (0)