Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/the-new-architecture/pure-cxx-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module
The rest of this guide assumes that you have created your application running the command:

<CodeBlock language="bash" title="shell">
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
{`npx @react-native-community/cli@latest init SampleApp --version "${getCurrentVersion()}"`}
</CodeBlock>

## 1. Create the JS specs
Expand Down
2 changes: 1 addition & 1 deletion docs/the-new-architecture/using-codegen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The **Codegen** process is tightly coupled with the build of the app, and the sc
For the sake of this guide, create a project using the React Native CLI as follows:

<CodeBlock language="bash" title="shell">
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
{`npx @react-native-community/cli@latest init SampleApp --version "${getCurrentVersion()}"`}
</CodeBlock>

**Codegen** is used to generate the glue-code for your custom modules or components. See the guides for Turbo Native Modules and Fabric Native Components for more details on how to create them.
Expand Down
2 changes: 1 addition & 1 deletion docs/turbo-native-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The basic steps are:
Lets work through each of these steps by building an example Turbo Native Module. The rest of this guide assume that you have created your application running the command:

<CodeBlock language="bash" title="shell">
{`npx @react-native-community/cli@latest init TurboModuleExample --version ${getCurrentVersion()}`}
{`npx @react-native-community/cli@latest init TurboModuleExample --version "${getCurrentVersion()}"`}
</CodeBlock>

## Native Persistent Storage
Expand Down
7 changes: 6 additions & 1 deletion website/src/getCurrentVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@ import {useActiveVersion} from '@docusaurus/plugin-content-docs/client';

export function getCurrentVersion() {
const version = useActiveVersion(undefined);
return version.label === 'Next' ? 'latest' : version.label;
if (!version || version.label === 'Next') {
return 'latest';
}
return /^\d+\.\d+$/.test(version.label)
? `${version.label}.0`
: version.label;
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In this guide, we will go through the creation of a pure C++ Turbo Native Module
The rest of this guide assumes that you have created your application running the command:

<CodeBlock language="bash" title="shell">
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
{`npx @react-native-community/cli@latest init SampleApp --version "${getCurrentVersion()}"`}
</CodeBlock>

## 1. Create the JS specs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The **Codegen** process is tightly coupled with the build of the app, and the sc
For the sake of this guide, create a project using the React Native CLI as follows:

<CodeBlock language="bash" title="shell">
{`npx @react-native-community/cli@latest init SampleApp --version ${getCurrentVersion()}`}
{`npx @react-native-community/cli@latest init SampleApp --version "${getCurrentVersion()}"`}
</CodeBlock>

**Codegen** is used to generate the glue-code for your custom modules or components. See the guides for Turbo Native Modules and Fabric Native Components for more details on how to create them.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The basic steps are:
Lets work through each of these steps by building an example Turbo Native Module. The rest of this guide assume that you have created your application running the command:

<CodeBlock language="bash" title="shell">
{`npx @react-native-community/cli@latest init TurboModuleExample --version ${getCurrentVersion()}`}
{`npx @react-native-community/cli@latest init TurboModuleExample --version "${getCurrentVersion()}"`}
</CodeBlock>

## Native Persistent Storage
Expand Down