Skip to content

Commit

Permalink
Fix typings for ReactNativeVersion.js
Browse files Browse the repository at this point in the history
This is an eager cherry pick of facebook#39784 for `0.73-stable`.
  • Loading branch information
huntie committed Oct 3, 2023
1 parent 6b9cf50 commit b6c0703
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ function _formatVersion(
): string {
return (
`${version.major}.${version.minor}.${version.patch}` +
// eslint-disable-next-line eqeqeq
(version.prerelease != undefined ? `-${version.prerelease}` : '')
(version.prerelease != null ? `-${version.prerelease}` : '')
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type ReactNativeVersionAndroid = {|
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|};

export type PlatformConstantsAndroid = {|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type PlatformConstantsIOS = {|
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
forceTouchAvailable: boolean,
osVersion: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Platform: PlatformType = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
Version: number,
Release: string,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native/Libraries/Utilities/Platform.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type IOSPlatform = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
systemName: string,
|},
Expand Down Expand Up @@ -60,7 +60,7 @@ type AndroidPlatform = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
Version: number,
Release: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Utilities/Platform.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const Platform: PlatformType = {
major: number,
minor: number,
patch: number,
prerelease: ?number,
prerelease: ?string,
|},
systemName: string,
|} {
Expand Down

0 comments on commit b6c0703

Please sign in to comment.