Moving Towards a Stable JavaScript API (New Changes in 0.80)
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'stsconfig.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.