mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fix: isVision return false for Platform.android.js (#42381)
Summary: This PR is a follow up for https://github.com/facebook/react-native/issues/42243 it looks like we need to return `false` for the Platform.android.js to make flow happy. This is the error we were getting in `react-native-visionos` CI/CD:  ## Changelog: [INTERNAL] [FIXED] - Add `isVision` interface idiom for Platform.android.js Pull Request resolved: https://github.com/facebook/react-native/pull/42381 Test Plan: CI Green Reviewed By: cortinico Differential Revision: D52905993 Pulled By: NickGerleman fbshipit-source-id: 125d33b63e9114cb6276b554e426f32e0c406ea8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b9621976bc
commit
3d09b6f850
@@ -69,6 +69,10 @@ const Platform: PlatformType = {
|
||||
// $FlowFixMe[object-this-reference]
|
||||
return this.constants.uiMode === 'tv';
|
||||
},
|
||||
// $FlowFixMe[unsafe-getters-setters]
|
||||
get isVision(): boolean {
|
||||
return false;
|
||||
},
|
||||
select: <T>(spec: PlatformSelectSpec<T>): T =>
|
||||
'android' in spec
|
||||
? // $FlowFixMe[incompatible-return]
|
||||
|
||||
@@ -80,6 +80,8 @@ type AndroidPlatform = {
|
||||
// $FlowFixMe[unsafe-getters-setters]
|
||||
get isTV(): boolean,
|
||||
// $FlowFixMe[unsafe-getters-setters]
|
||||
get isVision(): boolean,
|
||||
// $FlowFixMe[unsafe-getters-setters]
|
||||
get isTesting(): boolean,
|
||||
// $FlowFixMe[unsafe-getters-setters]
|
||||
get isDisableAnimations(): boolean,
|
||||
|
||||
@@ -9940,6 +9940,7 @@ type AndroidPlatform = {
|
||||
Manufacturer: string,
|
||||
|},
|
||||
get isTV(): boolean,
|
||||
get isVision(): boolean,
|
||||
get isTesting(): boolean,
|
||||
get isDisableAnimations(): boolean,
|
||||
select: <T>(spec: PlatformSelectSpec<T>) => T,
|
||||
|
||||
Reference in New Issue
Block a user