Quick Facts
- Category: Web Development
- Published: 2026-05-03 19:31:06
- From Basement to Global: How Runpod Built a Cloud with Community Backing
- Navigating the Jakarta EE Ecosystem: A Comprehensive Series Overview
- 10 Things You Need to Know About the Smartphone Price Hikes Hit OnePlus, Nothing, and More
- Fedora's Contributor Recognition 2026: Nominations Now Open for Mentors and Contributors
- How Meta's Unified AI Agents Are Transforming Hyperscale Efficiency
React Native 0.80 introduces two important changes to its JavaScript API: the deprecation of deep imports and a new optional Strict TypeScript API. These changes are part of a larger effort to define a stable, predictable public API that offers reliable type safety for developers and frameworks. The deprecation of deep imports reduces the surface area of the API, making it easier to maintain and stabilize. The Strict TypeScript API provides more accurate, generated types that ensure future-proof type checking. Both changes require adjustments from the community, but they pave the way for a more robust React Native experience.
What are the major JavaScript API changes in React Native 0.80?
React Native 0.80 introduces two primary changes to its JavaScript API. First, deep imports from the react-native package are now deprecated, meaning you should stop importing from subpaths like react-native/Libraries/Alert/Alert and instead use the root import (import { Alert } from 'react-native'). Second, there is an opt-in Strict TypeScript API that offers a new, generated baseline of TypeScript types for the public API. Previously, React Native relied on community-contributed Flow types that required manual maintenance and introduced correctness gaps. The new Strict TypeScript API is more accurate and future-proof, leveraging automated tooling to generate types directly from source. Both changes are groundwork for a stable API in future releases.
Why is React Native deprecating deep imports?
Deep imports—paths that reach directly into internal library folders like react-native/Libraries/—have historically been accessible to app code, but they were never intended as part of the public API. Because internal modules change frequently during React Native updates, deep imports often break without notice. By deprecating them, React Native reduces its public API surface to a fixed set of exports that can be controlled and stabilized. This change also makes the API easier to document, test, and type-check. The goal is to eventually remove deep import paths entirely (targeted for version 0.82), forcing all consumers to use only the official root exports. This ensures that developers rely on stable, supported interfaces rather than internal implementation details.
What exactly are deep imports and how should I update my code?
Deep imports are imports that specify a full path inside the react-native package, such as import { Alert } from 'react-native/Libraries/Alert/Alert'. The correct way is to import from the root: import { Alert } from 'react-native'. To update, search your codebase for any path starting with react-native/ (excluding the root import itself) and replace it with the root import, using the appropriate named export. If a component or function is not exported at root, you may need to find an alternative or provide feedback to the React Native team. Starting in 0.80, you'll see ESLint warnings and JS console warnings for deep imports, so it's easy to identify them. Plan to address these before version 0.82 when deep imports are expected to be removed.
What is the Strict TypeScript API and how do I opt in?
The Strict TypeScript API is a new, generated set of TypeScript type definitions for React Native's public API. Unlike the previous community-maintained types, this API is generated directly from the source code, ensuring accuracy and consistency. To opt in, add the following to your project's tsconfig.json under compilerOptions: "strict": true or specifically enable the new strict mode. (Check the official documentation for exact compiler options.) This is a one-time breaking change: some existing types may differ, requiring minor code adjustments. Once enabled, you benefit from more precise type checking that aligns with the actual runtime behavior. The Strict TypeScript API will become the default in a future release after community feedback and iteration, giving everyone time to migrate.
What will happen if I don't update my deep imports?
If you ignore the deprecation warnings, your code will continue to work in React Native 0.80 and likely 0.81, but deep imports will be removed entirely in version 0.82. At that point, any remaining deep imports will cause runtime errors or missing module failures. Additionally, the deprecation warnings in ESLint and the console are there to help you proactively fix issues before they become breaking. If you rely on an API that is only available via deep import and not yet exposed at root, you should share your use case in the feedback thread so the React Native team can consider adding it to the public API. By updating early, you ensure a smooth upgrade path to future versions.
How will the community be involved in finalizing the public API exports?
The React Native team has opened a feedback thread specifically for discussing which APIs should be exported at root. Some APIs currently only accessible via deep imports may not be part of the official public API. The team is actively working with the community to identify these cases and decide whether to include them in the root exports. Developers are encouraged to submit their feedback, especially if they rely on an internal API that is missing from the root. This collaborative process ensures that the new stable API covers the needs of the ecosystem while still protecting internal implementation details. Over time, the team will also work with popular frameworks and libraries to ensure compatibility before enabling the Strict TypeScript API by default.
Is there a way to opt out of these changes?
For deep imports, there is no opt-out mechanism; the deprecation warnings are just warnings, but the paths will be removed in 0.82. It is strongly recommended to migrate rather than postpone. For the Strict TypeScript API, opting in is optional in 0.80—you can continue using the existing community types by not enabling the new compiler options. However, since the new TypeScript types will become the default in a future release, it's wise to start testing with them now. If you need to temporarily suppress warnings for deep imports, you can adjust your ESLint configuration or use // eslint-disable-next-line comments, but be aware of the impending removal. The best long-term approach is to update your imports and enable the new strict mode gradually.
What is the long-term goal of these changes?
The ultimate objective is to offer a truly stable React Native JavaScript API that developers and framework authors can rely on without fear of accidental breaking changes. By deprecating deep imports, React Native shrinks its public API to a controlled set of exports, making it easier to version and document. Introducing the Strict TypeScript API ensures that type definitions are accurate and automatically generated, reducing maintenance burden and improving developer experience. These changes lay the foundation for a future where React Native's API is predictable, well-typed, and backward-compatible within major versions. The team is committed to working with the community throughout the transition, gathering feedback, and iterating before making these defaults permanent.