Skip to content

React Native 0.80 deprecates deep imports, adds Strict TypeScript API

updated

React Native 0.80 introduces two changes to the framework's JavaScript API: the deprecation of deep imports from the react-native package, and a new opt-in Strict TypeScript API. The post describes both as part of an ongoing effort to define the public API accurately and provide dependable type safety.

Deep imports deprecated

Starting in 0.80, deep imports such as react-native/Libraries/Alert/Alert trigger warnings in ESLint and the JS console. Values and types should be imported from the root instead:

// Before - import from subpath
import {Alert} from 'react-native/Libraries/Alert/Alert';

// After - import from `react-native`
import {Alert} from 'react-native';

The team is targeting removal of these import paths in 0.82. Some APIs are not exported at root and would become unavailable without deep imports; an open feedback thread is collecting input to finalize the public exports, and justified APIs may be promoted to the index export.

Warnings can be silenced by disabling the @react-native/no-deep-imports ESLint rule via overrides, and by passing {disableDeepImportWarnings: true} to @react-native/babel-preset (or babel-preset-expo for Expo projects), then restarting with npx @react-native-community/cli start --reset-cache or npx expo start --clear.

Strict TypeScript API

The new types ship alongside the existing ones and are enabled through tsconfig.json:

{
  "extends": "@react-native/typescript-config",
  "compilerOptions": {
    ...
    "customConditions": ["react-native-strict-api"]
  }
}

This makes TypeScript resolve types from the new types_generated/ directory rather than the manually maintained types/ directory. The new types are generated directly from React Native's Flow source and are restricted to the package's index file.

Opting in is a one-time breaking change affecting TypeScript analysis only, with no runtime impact:

  • Deep imports are not resolvable; types must come from 'react-native'.
  • Some type names and shapes have changed. For example, Linking is now a single interface instead of separate Linking and LinkingStatic exports.
  • Previous type gaps are fixed, e.g. densityDpi from Dimensions.get() is now typed as number | undefined.

A dedicated guide in the docs lists all breaking type changes.

Rollout

The react-native-strict-api opt-in is stable in 0.80, and apps and libraries can migrate at their own pace, since tsconfig.json only affects the immediate codebase. The Strict API will remain opt-in for at least the next two releases; it is planned to become the default in the future, synchronized with deep import removal, and all codebases will eventually be required to use it as the legacy types are removed. The timeline will depend on community feedback.

The post states this does not yet guarantee a final API: "We're formalizing the existing API you know and love." Future API changes will be communicated through RFCs or announcements, typically with a deprecation cycle. It also explains that React Native remains authored in Flow, which the post says offers the team greater performance and greater strictness than TypeScript, including specific multi-platform support for React Native.

The work was done by Iwo Plaza, Jakub Piasecki, Dawid Małecki, Alex Hunt, and Riccardo Cipolleschi, and was also presented in a talk at App.js 2025.

Source: reactnative.dev