Distribute type definitions in the react-native
package and phase out @types/react-native
#490
tom-sherman
started this conversation in
Ideas
Replies: 2 comments 5 replies
-
Problem is, react-native is typed with Flow because that's what is used within the Meta monorepo. So TS types can't be added to the react-native node_module and the best thing you can do is instead submit PRs to the DefinitelyTyped repo to address the issues you face. |
Beta Was this translation helpful? Give feedback.
5 replies
-
We've done just this! We will be deprecating @types/react-native from 0.72 onward. See changes here: facebook/react-native@6b2a511 These changes will be in the 0.71 release so you can remove the @types/react-native requirement for anyone using 0.71 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm raising this after we forgot to bump
@types/react-native
in our app and it caused a bug. The bug was autocomplete broke after we upgraded to 0.66, because that release removedautoCompleteType
on Android in favour ofautoComplete
.The root cause here IMO is that developers need to be careful when upgrading React Native that they also upgrade the types package.
The preferred solution here, which eliminates the problem entirely, is to distribute the types in official React Native releases.
I understand why this wasn't done historically, TypeScript wasn't as widespread as it is now. However I would guess (and if anyone has data please share!) a vast majority of apps are written in TypeScript and could benefit from this change.
Beta Was this translation helpful? Give feedback.
All reactions