React Native Blog Jan 3, 2023

React Native Adopts TypeScript-First Approach

Article Summary

React Native just made TypeScript the default. No more @types/react-native dependency, no more version lag, and a completely TypeScript-first developer experience starting with version 0.71.

The React Native team announced a major shift in their TypeScript support strategy with the 0.71 release. After years of relying on community-maintained type definitions, React Native now ships with built-in TypeScript declarations and a TypeScript-first approach across the entire framework.

Key Takeaways

Critical Insight

React Native 0.71 marks the end of community-maintained type definitions and establishes TypeScript as the framework's primary language with built-in declarations and tooling.

The migration path reveals some interesting implications for library maintainers and Flow users that could affect your upgrade timeline.

About This Article

Problem

TypeScript declarations for React Native lived in DefinitelyTyped separately, which meant @types/react-native lagged behind. It only had types for stable releases, so pre-release development was inaccurate and error-prone.

Solution

Starting with version 0.71, React Native moved TypeScript declarations into its source repository. This removed the need for manual inspection and kept types in sync with each release.

Impact

The React Native team will deprecate @types/react-native for versions 0.73 and later. Versions 0.71 and 0.72 will get identical types from both sources during the transition before switching fully to built-in declarations.