Skip to content

add helpers and components to resolve docs version automatically#4817

Merged
Simek merged 2 commits into
mainfrom
@simek/helpers-and-component-to-resolve-version-automatically
Sep 23, 2025
Merged

add helpers and components to resolve docs version automatically#4817
Simek merged 2 commits into
mainfrom
@simek/helpers-and-component-to-resolve-version-automatically

Conversation

@Simek

@Simek Simek commented Sep 23, 2025

Copy link
Copy Markdown
Collaborator

Why

In some docs we use command and links including specific React Native version, but those link often did not get updated when new version is cut.

The most prominent use-case are the "Integration with Existing Apps" docs.

How

Add helpers and components to resolve docs version automatically for the few cases:

  • getCurrentVersion() helper returns the current docs version as string mapping Next to latest
  • getTemplateBranchNameForCurrentVersion() helper returns the current docs version as string mapping the version to branch name in the community template repository
  • <RNTemplateRepoLink /> component simplifies linking to a specific file within community template repository

The changes have been applied to the unversioned docs, and also backported to docs for 0.81.

Preview

Screenshot 2025-09-23 at 12 43 56

@netlify

netlify Bot commented Sep 23, 2025

Copy link
Copy Markdown

Deploy Preview for react-native ready!

Name Link
🔨 Latest commit fb1b261
🔍 Latest deploy log https://app.netlify.com/projects/react-native/deploys/68d27d5f0900c60008b1a14c
😎 Deploy Preview https://deploy-preview-4817--react-native.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/0.78-stable/template/package.json
```
<CodeBlock language="bash" title="shell">
{`curl -O https://raw.githubusercontent.com/react-native-community/template/refs/heads/${getTemplateBranchNameForCurrentVersion()}/template/package.json`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this 🙏

@Simek Simek merged commit 494818f into main Sep 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants