Replies: 18 comments 35 replies
-
Hey @huntie I believe that change will break You can see here how it's done: https://github.com/kirillzyusko/react-native-keyboard-controller/blob/main/src/monkey-patch.android.ts (obviously the solution is a dirty workaround, but it was working for years 🙈) I'll be happy to discuss a better solution/alternative for that or at least add temporarily |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
[Done] Expose
|
Beta Was this translation helpful? Give feedback.
-
Just saw this through the 0.80 release. Please consider exporting |
Beta Was this translation helpful? Give feedback.
-
Sorry I dunno if this is the right place to say that, I tried the new strict api on my react native project and I'm getting 94 parsing errors, I had to disabled it for now. Let me know if you need any more info See parsing errors
Found 94 errors in the same file, starting at: node_modules/react-native/Libraries/ReactPrivate/ReactNativePrivateInterface.js:11. I've some custom tsconfig but even after disabling them the result is the same. |
Beta Was this translation helpful? Give feedback.
-
react-native-network-logger uses |
Beta Was this translation helpful? Give feedback.
-
[Done] Expose
|
Beta Was this translation helpful? Give feedback.
-
Hello, migrating these to import from The new imports are done like this. This could be valuable to mention in the FAQ for library maintainers here. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Thanks for the clarification! I wasn’t aware that deep imports were so widely used in the ecosystem. Looking forward to seeing what alternatives will be officially supported. |
Beta Was this translation helpful? Give feedback.
-
Does it mean the following mock will stop working in RN 0.82?
hence, I should convert that into this:
Could you confirm that? |
Beta Was this translation helpful? Give feedback.
-
[Done] Expose
|
Beta Was this translation helpful? Give feedback.
-
In our project we're using
Will it be available in future react-native versions or will be there a replacement for it? |
Beta Was this translation helpful? Give feedback.
-
Please expose import parseErrorStack from "react-native/Libraries/Core/Devtools/parseErrorStack";
I notice they're not currently in the provisional public API. Currently both React Navigation and Sentry are manually parsing the error stack, which seems fragile (especially with Static Hermes on the horizon), and an unreasonable maintenance burden to have to do in userland. I also want to implement proper stack traces for my userland util.inspect() polyfill that brings |
Beta Was this translation helpful? Give feedback.
-
I am currently relying on a deep import of The const ReactNative = require("react-native");
// This approach only works with a deep import, not a shallow import.
const Platform = require("react-native/Libraries/Utilities/Platform");
/** @type {"ios" | "android"} */
const OS = "ios";
/** @type {import("react-native").Platform} */
const PlatformCommon = {
OS,
constants: {
reactNativeVersion: {
major: 1000,
minor: 0,
patch: 0,
prerelease: undefined,
},
},
__constants: null,
isPad: false,
isTV: false,
isVision: false,
isTesting: undefined,
isDisableAnimations: undefined,
isMacCatalyst: false,
select: function select(spec) {
return OS in spec
? spec[OS]
: "native" in spec
? spec.native
: spec.default;
},
};
// TODO: find a way to swap between these based on test
const IosPlatform = { ...PlatformCommon, Version: "17.5" };
const AndroidPlatform = { ...PlatformCommon, Version: 33 };
const ResolvedPlatform = OS === "ios" ? IosPlatform : AndroidPlatform;
Object.assign(Platform, ResolvedPlatform);
Object.defineProperties(ReactNative, {
Platform: {
get: () => ResolvedPlatform,
},
}); To be clear, I'm not proposing to expose the |
Beta Was this translation helpful? Give feedback.
-
So if we have a
|
Beta Was this translation helpful? Give feedback.
-
There doesn't seem to be any alternative to typing this correctly. |
Beta Was this translation helpful? Give feedback.
-
Re.Pack Development APIsContextRe.Pack's HMR client (WebpackHMRClient) reimplements React Native's HMRClient and uses the following APIs: 1. NativeRedBox & NativeExceptionsManagerModule Paths:
Purpose: Implementation: if (__PLATFORM__ === 'ios') {
const NativeRedBox =
require('react-native/Libraries/NativeModules/specs/NativeRedBox').default;
NativeRedBox?.dismiss?.();
} else {
const NativeExceptionsManager =
require('react-native/Libraries/Core/NativeExceptionsManager').default;
NativeExceptionsManager?.dismissRedbox();
} Source: 2. DevLoadingViewModule Paths:
Purpose: Implementation: const LoadingView = require('react-native/Libraries/Utilities/DevLoadingView');
LoadingView.showMessage(text, type); Source: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Introduction
See the RFC | See the 0.80 release post
🚨 Key change: In React Native 0.80, we are deprecating subpath imports (or "deep imports") from the
react-native
npm package.By defining a clear, root-level JavaScript API contract, we aim to minimise future React Native breaking changes and improve long-term predictability for the ecosystem.
Why it matters: While initially deprecated with warnings, we aim to remove these import paths entirely, which will be a breaking change.
This discussion thread
Please raise issues/questions about APIs you are using that are affected by this change. Over our API consultation period (beginning 0.80), we'll evaluate requests for exposing new APIs at the root, or providing alternatives.
Planned sequencing
"exports"
and the Strict TypeScript API.What we've actioned!
https://github.com/facebook/react-native/issues?q=sort%3Acreated-desc%20label%3A%22JS%20API%20refinements%20(2025)%22
Beta Was this translation helpful? Give feedback.
All reactions