diff --git a/packages/react-native/Libraries/Core/ReactNativeVersionCheck.js b/packages/react-native/Libraries/Core/ReactNativeVersionCheck.js index 8b41988696d6b5..dacca4408e0c13 100644 --- a/packages/react-native/Libraries/Core/ReactNativeVersionCheck.js +++ b/packages/react-native/Libraries/Core/ReactNativeVersionCheck.js @@ -39,8 +39,12 @@ exports.checkVersions = function checkVersions(): void { } }; +// Note: in OSS, the prerelease version is usually 0.Y.0-rc.W, so it is a string and not a number +// Then we need to keep supporting that object shape. function _formatVersion( - version: (typeof Platform)['constants']['reactNativeVersion'], + version: + | (typeof Platform)['constants']['reactNativeVersion'] + | {major: number, minor: number, patch: number, prerelease: ?string}, ): string { return ( `${version.major}.${version.minor}.${version.patch}` +