Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript error with @types/react-native@0.70.4 due to usage of Platform.isTVOS #1604

Closed
SimpleCreations opened this issue Oct 2, 2022 · 1 comment · Fixed by #1605
Closed
Assignees
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Platform: tvOS Issue related with tvOS compatibility Platform: Web This issue is specific to web Platform: Windows This issue is specific to Windows

Comments

@SimpleCreations
Copy link

Description

The following file uses Platform.isTVOS which was removed in the latest version of @types/react-native. This causes an error when running tsc.

if (Platform.isPad || Platform.isTVOS) {

node_modules/react-native-screens/src/native-stack/utils/getDefaultHeaderHeight.tsx:25:36 - error TS2551: Property 'isTVOS' does not exist on type 'PlatformIOSStatic'. Did you mean 'isTV'?

Steps to reproduce

See description

Snack or a link to a repository

Not needed

Screens version

3.17.0

React Native version

0.70.1

Platforms

Android, iOS, Web, Windows, tvOS

JavaScript runtime

No response

Workflow

No response

Architecture

No response

Build type

No response

Device

No response

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Platform: tvOS Issue related with tvOS compatibility Platform: Web This issue is specific to web Platform: Windows This issue is specific to Windows Missing repro This issue need minimum repro scenario labels Oct 2, 2022
@github-actions
Copy link

github-actions bot commented Oct 2, 2022

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@kkafar kkafar self-assigned this Oct 2, 2022
kkafar added a commit that referenced this issue Oct 3, 2022
## Description

Fixes #1604 

`Platform.isTVOS` check was removed with `react-native@0.70` [(see the
PR)](facebook/react-native#34071) as it was only
wrapper for `Platform.isTV` check (which exists since `0.61`).

## Changes

Dropped usage of removed `Platform.isTVOS` check in favour of
`Platform.isTV`.

## Test code and steps to reproduce

See #1604 -- check on any app that the library now works with
`@types/react-native@0.70.*`

## Checklist

- [x] Ensured that CI passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Platform: tvOS Issue related with tvOS compatibility Platform: Web This issue is specific to web Platform: Windows This issue is specific to Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants