New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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)
Comments
sailor1861
added
Needs: Triage 🔍
Type: New Architecture
Issues and PRs related to new architecture (Fabric/Turbo Modules)
labels
May 6, 2024
|
github-actions
bot
added
Needs: Author Feedback
Needs: Repro
This issue could be improved with a clear list of steps to reproduce the issue.
labels
May 6, 2024
|
try using TurboModuleRegistry.getEnforcing('SourceCode').getConstants().scriptURL or SourceCode.getConstants().scriptURL |
TurboModuleRegistry.getEnforcing('SourceCode').getConstants().scriptUR is OK;thanks @arunrajput |
github-actions
bot
added
Needs: Attention
Issues where the author has responded to feedback.
and removed
Needs: Author Feedback
labels
May 7, 2024
cortinico
added
Resolution: Answered
When the issue is resolved with a simple answer
and removed
Needs: Triage 🔍
Needs: Repro
This issue could be improved with a clear list of steps to reproduce the issue.
Needs: Attention
Issues where the author has responded to feedback.
labels
May 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: