Skip to content

Commit

Permalink
fix flow
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Nov 23, 2023
1 parent 896648c commit 8cfe6f9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/react-native/Libraries/Utilities/Platform.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ const Platform: PlatformType = {
// $FlowFixMe[object-this-reference]
return this.constants.uiMode === 'tv';
},
// $FlowFixMe[unsafe-getters-setters] - please Flow for now, TODO fix later
get isVisionOS(): boolean {
return false;
},
select: <T>(spec: PlatformSelectSpec<T>): T =>
'android' in spec
? // $FlowFixMe[incompatible-return]
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native/Libraries/Utilities/Platform.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ type AndroidPlatform = {
|},
// $FlowFixMe[unsafe-getters-setters]
get isTV(): boolean,
// $FlowFixMe[unsafe-getters-setters] - please Flow for now, TODO fix later
get isVisionOS(): boolean,
// $FlowFixMe[unsafe-getters-setters]
get isTesting(): boolean,
// $FlowFixMe[unsafe-getters-setters]
Expand Down
12 changes: 8 additions & 4 deletions packages/react-native/Libraries/Utilities/Platform.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ const Platform: PlatformType = {
select: <T>(spec: PlatformSelectSpec<T>): T =>
// $FlowFixMe[incompatible-return]
'visionos' in spec
? spec.visionos
? // $FlowFixMe[incompatible-return]
spec.visionos
: 'ios' in spec
? spec.ios
? // $FlowFixMe[incompatible-return]
spec.ios
: 'native' in spec
? spec.native
: spec.default,
? // $FlowFixMe[incompatible-return]
spec.native
: // $FlowFixMe[incompatible-return]
spec.default,
};

module.exports = Platform;

0 comments on commit 8cfe6f9

Please sign in to comment.