question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typescript type definitions missing for react-native > 0.67.7

See original GitHub issue

Description

Since upgrading to latest Expo SDK 45 our application is on react-native@0.68.2. Trying to upgrade @types/react-native too, I found out that the latest type definitions published is 0.67.7.

We experience some type warnings in IDEs and hope that these result from this version mismatch. In any case, having both react-native and @types/react-native in the same package versions should help to avoid people getting confused.

Version

0.68.2

Output of npx react-native info

(run in a monorepo in an Expo project, it seems the output does not really resemble the reality)

npx react-native info
info Fetching system and libraries information...
System:
    OS: macOS 12.4
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 50.79 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.17.3 - ~/.nodenv/versions/14.17.3/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.1.4 - ~/.nodenv/versions/14.17.3/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 28, 31, 32
      Build Tools: 29.0.2, 32.0.0, 32.1.0
      System Images: android-30 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 2020.3 AI-203.7717.56.2031.7935034
    Xcode: 13.4/13F17a - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

yarn add react-native
yarn add @types/react-native
cat package.json

Snack, code example, screenshot, or link to a repository

See “Steps to reproduce”.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kelsetcommented, May 25, 2022

👋 just writing a comment to clarify that I’m trying to get someone to properly own and drive the @types/react-native situation but until then, basically noone is currently in charge of them 🥲

What you could do is go over the DefinitelyTyped repo and submit a PR to get the new version of the types to get created (akin to https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59641).

I’m sorry that the situation is the way it is right now, and I hope I’ll be able to provide an update with some good news in the near future 🤞

1reaction
cortinicocommented, Jun 21, 2022

one they are merged, we can go ahead and close this

Closing as they’re merged 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

@types/react-native - npm
This package contains type definitions for react-native (https://github.com/facebook/react-native). Details. Files were exported from https:// ...
Read more >
types/react-native/index.d.ts - UNPKG
1, // Type definitions for react-native 0.67. 2, // Project: https://github.com/facebook/react-native. 3, // Definitions by: Eloy Durán ...
Read more >
'view' cannot be used as a jsx component. its instance type ...
Upgrading to @types/react 18 is throwing typescript errors, in all react native components. 'View' cannot be used as a JSX component. Its instance...
Read more >
Active questions tagged react-native+typescript - Stack Overflow
Following the type checking with TypeScript, I specifying undefined for param of the route in type.js. export type BottomTabNavigatorParamList = { OTP: ...
Read more >
Using TypeScript - React Native
TypeScript is a language which extends JavaScript by adding type definitions, much like Flow. While React Native is built in Flow, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found