add helpers and components to resolve docs version automatically#4817
Merged
Simek merged 2 commits intoSep 23, 2025
Merged
Conversation
✅ Deploy Preview for react-native ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
cortinico
approved these changes
Sep 23, 2025
| 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`} |
Contributor
There was a problem hiding this comment.
Thanks for fixing this 🙏
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 mappingNexttolatestgetTemplateBranchNameForCurrentVersion()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 repositoryThe changes have been applied to the unversioned docs, and also backported to docs for 0.81.
Preview