Skip to content

Expose ReactNativeVersion API #52784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

huntie
Copy link
Member

@huntie huntie commented Jul 23, 2025

Summary:
Resolves react-native-community/discussions-and-proposals#893 (comment).

Changes

  • Formalises the design of ReactNativeVersion as a single object and adds a getVersionString accessor.
  • Expose ReactNativeVersion as a root export on index.js.
  • Update deep imports use in NewAppScreen.

Notes

  • Subtly, we also have Platform.constants.reactNativeVersion in our public API already. However, this is the per-platform native-reported RN version, distinct from the JS version (this diff). See ReactNativeVersionCheck.js.

Changelog:
[General][Added] - Expose ReactNativeVersion API as JavaScript root export

Differential Revision: D78806347

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jul 23, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78806347

@react-native-bot
Copy link
Collaborator

react-native-bot commented Jul 23, 2025

Warnings
⚠️

❗ JavaScript API change detected - This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API. Please include a clear changelog message. This change will be subject to extra review.

This change was flagged as: POTENTIALLY_NON_BREAKING

Generated by 🚫 dangerJS against 4487265

Summary:

Resolves react-native-community/discussions-and-proposals#893 (comment).

**Changes**

- Formalises the design of `ReactNativeVersion` as a single object and adds a `getVersionString` accessor.
- Expose `ReactNativeVersion` as a root export on `index.js`.
- Update deep imports use in `NewAppScreen`.

**Notes**

- Subtly, we also have `Platform.constants.reactNativeVersion` in our public API already. **However**, this is the per-platform ***native-reported*** RN version, distinct from the JS version (this diff). See [`ReactNativeVersionCheck.js`](https://github.com/facebook/react-native/blob/54d733311d87e9ab4e18f947edf3f5c85f9a6275/packages/react-native/Libraries/Core/ReactNativeVersionCheck.js#L24).

Changelog:
[General][Added] - Expose `ReactNativeVersion` API as JavaScript root export

Differential Revision: D78806347
@huntie huntie force-pushed the export-D78806347 branch from eb02a95 to 4487265 Compare July 23, 2025 12:44
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D78806347

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 23, 2025
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in ec5638a.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @huntie in ec5638a

When will my fix make it into a release? | How to file a pick request?

@huntie huntie deleted the export-D78806347 branch July 23, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants