How to replace NativeModules.SourceCode under Fabric architecture? #44418
Labels
Newer Patch Available
Resolution: Answered
When the issue is resolved with a simple answer
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
Description
Hello,
I'm currently transitioning to the new React Native Fabric architecture and I'm looking for a way to replace the functionality provided by
NativeModules.SourceCode
. In the legacy architecture, we usedNativeModules.SourceCode
to obtain information about the running JS bundle, such as its URL.Could you please provide guidance or point me towards the recommended approach for accessing this kind of information within the context of the Fabric architecture? Is there a new API or an alternative method that we should use now?
Thank you for your assistance.
Best regards,
Steps to reproduce
console.log("NativeModules.SourceCode:" + NativeModules.SourceCode + "; scriptURL" + NativeModules.SourceCode.scriptURL);
React Native Version
0.72.5
Affected Platforms
Runtime - Android
Areas
TurboModule - The New Native Module System
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://git.corp.com/GP_APPMAIN_RN/react-native-auto.git
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: