Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      How To Prevent WordPress SQL Injection Attacks

      June 13, 2025

      Java never goes out of style: Celebrating 30 years of the language

      June 12, 2025

      OpenAI o3-pro available in the API, BrowserStack adds Playwright support for real iOS devices, and more – Daily News Digest

      June 12, 2025

      Creating The “Moving Highlight” Navigation Bar With JavaScript And CSS

      June 11, 2025

      Microsoft Copilot’s own default configuration exposed users to the first-ever “zero-click” AI attack, but there was no data breach

      June 13, 2025

      Sam Altman says “OpenAI was forced to do a lot of unnatural things” to meet the Ghibli memes demand surge

      June 13, 2025

      5 things we didn’t get from the Xbox Games Showcase, because Xbox obviously hates me personally

      June 13, 2025

      Minecraft Vibrant Visuals finally has a release date and it’s dropping with the Happy Ghasts

      June 13, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      QAQ-QQ-AI-QUEST

      June 13, 2025
      Recent

      QAQ-QQ-AI-QUEST

      June 13, 2025

      JS Dark Arts: Abusing prototypes and the Result type

      June 13, 2025

      Helpful Git Aliases To Maximize Developer Productivity

      June 13, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      Microsoft Copilot’s own default configuration exposed users to the first-ever “zero-click” AI attack, but there was no data breach

      June 13, 2025
      Recent

      Microsoft Copilot’s own default configuration exposed users to the first-ever “zero-click” AI attack, but there was no data breach

      June 13, 2025

      Sam Altman says “OpenAI was forced to do a lot of unnatural things” to meet the Ghibli memes demand surge

      June 13, 2025

      5 things we didn’t get from the Xbox Games Showcase, because Xbox obviously hates me personally

      June 13, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Moving Towards a Stable JavaScript API (New Changes in 0.80)

    Moving Towards a Stable JavaScript API (New Changes in 0.80)

    June 11, 2025

    In React Native 0.80, we’re introducing two significant changes to React Native’s JavaScript API — the deprecation of deep imports, and our new Strict TypeScript API. These are part of an ongoing effort to accurately define our API and offer dependable type safety to users and frameworks.

    Quick takeaways:

    • Deep imports deprecation: From 0.80, we’re introducing deprecation warnings for deep imports from the react-native package.
    • Opt-in Strict TypeScript API: We are moving to from-source TypeScript types and a new public API baseline under TypeScript. These enable stronger and more futureproof type accuracy, and will be a one-time breaking change. Opt in via compilerOptions in your project’s tsconfig.json.
    • We’ll work with the community over time to ensure that these changes work for everyone, before enabling the Strict TypeScript API by default in a future React Native release.

    What’s changing and why​

    We are moving to improve and stabilise React Native’s public JavaScript API — i.e. what you get when you import 'react-native'.

    Historically, we’ve approximated this. React Native is authored in Flow, but the community has long since moved to TypeScript in open source, which is how the public API is consumed and validated for compatibility. Our types have been (lovingly) community-contributed, and since merged and aligned in our codebase. However, these have relied on manual maintenance and no automated tooling, introducing correctness gaps.

    Additionally, our public JS API has been poorly defined in terms of module boundaries — e.g. internal 'react-native/Libraries/' deep imports were reachable by app code, but could frequently change as we updated these internals.

    In 0.80, we’re addressing these issues by deprecating deep imports, and introducing a user opt-in to a new, generated API baseline in TypeScript. We’re calling this our Strict TypeScript API. Ultimately, this is the groundwork to offer a stable React Native API in future.

    Deprecating deep imports from react-native​

    The main change we’re making to our API today is deprecating the use of deep imports (RFC), with warnings in ESLint and the JS console. Deep imports of values and types should be updated to react-native‘s root import.

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

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

    This change reduces the total surface area of our JavaScript API into a fixed set of exports which we can control and make stable in a future release. We’re targeting a removal of these import paths in 0.82.

    API feedback

    Some APIs are not exported at root, and will become unavailable without deep imports. We have an open feedback thread and will be working with the community to finalize the exports in our public API. Please share your feedback!

    Opting out

    Please bear in mind that we aim to remove deep imports from React Native’s API in a future release, and these should instead be updated to the root import.

    Opting out of warnings

    ESLint​

    Disable the no-deep-imports rule using overrides.

    .eslintrc.js
      overrides: [
    {
    files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
    rules: {
    '@react-native/no-deep-imports': 0,
    },
    },
    ]

    Console warnings​

    Pass the disableDeepImportWarnings option to @react-native/babel-preset.

    babel.config.js
    module.exports = {
    presets: [
    ['module:@react-native/babel-preset', {disableDeepImportWarnings: true}]
    ],
    };

    Restart your app with --reset-cache to clear the Metro cache.

    npx @react-native-community/cli start --reset-cache
    Opting out of warnings (Expo)

    ESLint​

    Disable the no-deep-imports rule using overrides.

    .eslintrc.js
    overrides: [
    {
    files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
    rules: {
    '@react-native/no-deep-imports': 0,
    },
    },
    ];

    Console warnings​

    Pass the disableDeepImportWarnings option to babel-preset-expo.

    babel.config.js
    module.exports = function (api) {
    api.cache(true);
    return {
    presets: [['babel-preset-expo', {disableDeepImportWarnings: true}]],
    };
    };

    Restart your app with --clear to clear the Metro cache.

    npx expo start --clear

    Strict TypeScript API (opt-in)​

    The Strict TypeScript API is a new set of TypeScript types in the react-native package, which can be opted into via your tsconfig.json. We’re shipping these alongside our existing TS types, meaning you can choose to migrate when ready.

    The new types are:

    1. Generated directly from our source code — improving coverage and correctness, so you can expect stronger compatibility guarantees.
    2. Restricted to react-native‘s index file — more tightly defining our public API, and meaning we won’t break the API when making internal file changes.

    When the community is ready, the Strict TypeScript API will become our default API in future — synchronized with deep imports removal. This means it’s a good idea to begin opting in, as you’ll be ready for React Native’s future stable JS API.

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

    This will instruct TypeScript to resolve react-native types from our new types_generated/ dir, instead of the previous types/ dir (manually maintained). No restart of TypeScript or your text editor is required.

    Breaking: Deep imports are disallowed​

    As above, types under the Strict TypeScript API are now only resolvable from the main 'react-native' import path, enforcing package encapsulation, per our above deprecation.

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

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

    We’ve scoped our public API to the exports of React Native’s index.js file, which we carefully maintain. This means that file changes elsewhere in our codebase will no longer be breaking changes.

    Breaking: Some type names / shapes have changed​

    Types are now generated from source, rather than manually maintained. In doing this:

    • We’ve aligned differences that had built up from the community contributed types — and also increased the type coverage of our source code.
    • We’ve intentionally updated some type names and type shapes, where there was scope to simplify or reduce ambiguity.
    Key win

    Because types are now generated from React Native’s source code, you can be confident that the typechecker is always accurate for a given version of react-native.

    Example: Stricter exported symbols​

    The Linking API is now a single interface, rather than two exports. This follows for a number of other APIs (see docs).

    // Before
    import {Linking, LinkingStatic} from 'react-native';

    function foo(linking: LinkingStatic) {}
    foo(Linking);

    // After
    import {Linking} from 'react-native';

    function foo(linking: Linking) {}
    foo(Linking);

    Example: Fixed / more complete types​

    Previous manual type definitions left the opportunity for type gaps. Under generated Flow → TypeScript, these are no longer present (and at source, benefit from Flow’s additional type validation for multi-platform code).

    import {Dimensions} from 'react-native';

    // Before - Type error
    // After - number | undefined
    const {densityDpi} = Dimensions.get();

    Other breaking changes​

    Please refer to our dedicated guide in the docs which details all breaking types changes and how to update your code.

    Rollout​

    We appreciate that any breaking change to React Native will take time for developers to update to in their apps.

    Now — Opt-in launch (0.80)​

    The "react-native-strict-api" opt-in is stable in the 0.80 release.

    • This is a one-time migration. We aim for apps and libraries to opt in at their own pace over the next couple of releases.
    • Under either mode, nothing will change for your app at runtime — this affects TypeScript analysis only.
    • And, we will take feedback on missing APIs, via our dedicated feedback thread.
    Recommended

    The Strict TypeScript API will become our default API in future.

    If you have time, it’s worth testing the opt-in now in your tsconfig.json, to futureproof your app or library. This will immediately evaluate if there are any type errors introduced in your app under the Strict API. There may be none(!) — in which case, you’re good to go.

    Future — Strict TypeScript API by default​

    In the future, we will require all codebases to use our Strict API, and will remove the legacy types.

    The timeline for this will be based on community feedback. For at least the next two React Native releases, the Strict API will remain an opt-in.

    FAQs​

    I’m using subpath imports today. What should I do?

    Please migrate to the root 'react-native' import path.

    • Subpath imports (e.g. 'react-native/Libraries/Alert/Alert') are becoming private APIs. Without preventing access to implementation files inside React Native, we can’t offer a stable JavaScript API.
    • We want our deprecation warnings to motivate community feedback, which can be raised via our centralized discussion thread, if you believe we are not exposing code paths that are crucial for your app. Where justified, we may promote APIs to the index export.

    I’m a library maintainer. How does this change impact me?

    Both apps and libraries can opt in at their own pace, since tsconfig.json will only affect the immediate codebase.

    • Typically, node_modules is excluded from validation by the TypeScript server in a React Native project. Therefore, your package’s exported type definitions are the source of truth.

    💡 We want feedback! As with changed subpath imports, if you encounter any integration issues with the Strict API, please let us know on GitHub.

    Does this guarantee a final API for React Native yet?

    Sadly, not yet. In 0.80, we’ve made a tooling investment so that React Native’s existing JS API baseline can be accurately consumed via TypeScript — enabling future stable changes. We’re formalizing the existing API you know and love.

    In the future, we will take action to finalise the APIs we currently offer in core — across each language surface. API changes will be communicated via RFCs/announcements, and typically a deprecation cycle.

    Why isn’t React Native written in TypeScript?

    React Native is core infrastructure at Meta. We test every merged change across our Family of Apps, before they hit general open source availability.

    At this scale and sensitivity, correctness matters. The bottom line is that Flow offers us greater performance and greater strictness than TypeScript, including specific multi-platform support for React Native.

    Thanks​

    These changes were made possible by Iwo Plaza, Jakub Piasecki, Dawid Małecki, Alex Hunt, and Riccardo Cipolleschi.

    Thanks also to Pieter Vanderwerff, Rubén Norte, and Rob Hogan for their additional help and input.

    Learn more

    Watch the talk!
    We shared a deep dive into our motivations and the work behind the Strict TypeScript API at App.js 2025.
    View on YouTube

    App.js 2025 Talk

    Source: Read More

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleGitHub Availability Report: May 2025
    Next Article Develop a Multi-Tool AI Agent with Secure Python Execution using Riza and Gemini

    Related Posts

    Security

    Ransomware Gangs Exploit Unpatched SimpleHelp Flaws to Target Victims with Double Extortion

    June 13, 2025
    Security

    Paragon Spyware used to Spy on European Journalists

    June 13, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    Try It On: A Playful Drag-and-Drop Styling UI

    News & Updates

    Enigmata’s Multi-Stage and Mix-Training Reinforcement Learning Recipe Drives Breakthrough Performance in LLM Puzzle Reasoning

    Machine Learning

    Celebrate 30 years of PHP at PHPverse

    Development

    84,000+ Roundcube Webmail Installation Vulnerable to Remote Code Execution Attacks

    Security

    Highlights

    CVE-2025-3577 – Zyxel AMG1302-T10B Path Traversal Vulnerability

    April 22, 2025

    CVE ID : CVE-2025-3577

    Published : April 22, 2025, 3:15 a.m. | 3 hours, 55 minutes ago

    Description : **UNSUPPORTED WHEN ASSIGNED** A path traversal vulnerability in the web management interface of the Zyxel AMG1302-T10B firmware version 2.00(AAJC.16)C0 could allow an authenticated attacker with administrator privileges to access restricted directories by sending a crafted HTTP request to an affected device.

    Severity: 4.9 | MEDIUM

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-4554 – PHPGurukul Apartment Visitors Management System SQL Injection Vulnerability

    May 12, 2025

    Windows 11’s Android (WSA) finally loses support, but can you still install it?

    June 7, 2025
    Rogue npm Packages Mimic Telegram Bot API to Plant SSH Backdoors on Linux Systems

    Rogue npm Packages Mimic Telegram Bot API to Plant SSH Backdoors on Linux Systems

    April 19, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.