File tree Expand file tree Collapse file tree 5 files changed +37
-6
lines changed
packages/react-native/Libraries Expand file tree Collapse file tree 5 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 99 * @flow strict
1010 */
1111
12- exports . version = {
12+ const version : $ReadOnly < {
13+ major : number ,
14+ minor : number ,
15+ patch : number ,
16+ prerelease : string | null ,
17+ } > = {
1318 major : 1000 ,
1419 minor : 0 ,
1520 patch : 0 ,
1621 prerelease : null ,
1722} ;
23+
24+ module . exports = { version} ;
Original file line number Diff line number Diff line change @@ -21,15 +21,15 @@ const ReactNativeVersion = require('./ReactNativeVersion');
2121 * implementations for other platforms (ex: Windows) may override this module
2222 * and rely on its existence as a separate module.
2323 */
24- exports . checkVersions = function checkVersions ( ) : void {
24+ const checkVersions = function checkVersions ( ) : void {
2525 const nativeVersion = Platform . constants . reactNativeVersion ;
2626 if (
2727 ReactNativeVersion . version . major !== nativeVersion . major ||
2828 ReactNativeVersion . version . minor !== nativeVersion . minor
2929 ) {
3030 console . error (
3131 `React Native version mismatch.\n\nJavaScript version: ${ _formatVersion (
32- ReactNativeVersion . version ,
32+ ( ReactNativeVersion . version : $FlowFixMe ) ,
3333 ) } \n` +
3434 `Native version: ${ _formatVersion ( nativeVersion ) } \n\n` +
3535 'Make sure that you have rebuilt the native code. If the problem ' +
@@ -48,3 +48,5 @@ function _formatVersion(
4848 ( version . prerelease != undefined ? `-${ version . prerelease } ` : '' )
4949 ) ;
5050}
51+
52+ module . exports = { checkVersions} ;
Original file line number Diff line number Diff line change @@ -3851,6 +3851,23 @@ declare export default typeof ReactFiberErrorDialog;
38513851"
38523852`;
38533853
3854+ exports[`public API should not change unintentionally Libraries/Core/ReactNativeVersion.js 1`] = `
3855+ "declare const version: $ReadOnly<{
3856+ major: number,
3857+ minor: number,
3858+ patch: number,
3859+ prerelease: string | null,
3860+ }>;
3861+ declare module.exports: { version: version };
3862+ "
3863+ `;
3864+
3865+ exports[`public API should not change unintentionally Libraries/Core/ReactNativeVersionCheck.js 1`] = `
3866+ "declare const checkVersions: () => void;
3867+ declare module.exports: { checkVersions: checkVersions };
3868+ "
3869+ `;
3870+
38543871exports[`public API should not change unintentionally Libraries/Core/SegmentFetcher/NativeSegmentFetcher.js 1`] = `
38553872"export * from \\"../../../src/private/specs/modules/NativeSegmentFetcher\\";
38563873declare export default typeof NativeSegmentFetcher;
Original file line number Diff line number Diff line change @@ -42,8 +42,6 @@ const FILES_WITH_KNOWN_ERRORS = new Set([
4242 'Libraries/Components/Touchable/TouchableNativeFeedback.js' ,
4343 'Libraries/Components/Touchable/TouchableWithoutFeedback.js' ,
4444 'Libraries/Components/UnimplementedViews/UnimplementedView.js' ,
45- 'Libraries/Core/ReactNativeVersion.js' ,
46- 'Libraries/Core/ReactNativeVersionCheck.js' ,
4745 'Libraries/Image/ImageBackground.js' ,
4846 'Libraries/Inspector/ElementProperties.js' ,
4947 'Libraries/Inspector/BorderBox.js' ,
Original file line number Diff line number Diff line change 99 * @flow strict
1010 */
1111
12- exports.version = {
12+ const version: $ReadOnly<{
13+ major: number,
14+ minor: number,
15+ patch: number,
16+ prerelease: string | null,
17+ }> = {
1318 major: ${major},
1419 minor: ${minor},
1520 patch: ${patch},
1621 prerelease: ${prerelease},
1722};
23+
24+ module.exports = {version};
You can’t perform that action at this time.
0 commit comments