Description
Description
Hi !
When not using fabric, NativesModules can be imported from 'react-native', and then some modules can be used, for example to get the device locale:
? NativeModules.SettingsManager.settings.AppleLocale || NativeModules.SettingsManager.settings.AppleLanguages[0]
: NativeModules.I18nManager.localeIdentifier
After enabling fabric, this crashed because NativeModules is empty.
So my question is: What is the equivalent ? How do you access SettingsManager and I18nManager when fabric is enabled ?
Version
0.68
Output of npx react-native info
System:
OS: macOS 12.3
CPU: (10) x64 Apple M1 Pro
Memory: 38.38 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.8.0 - ~/.nvm/versions/node/v17.8.0/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.5.5 - ~/.nvm/versions/node/v17.8.0/bin/npm
Watchman: 2022.03.14.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.2 - /Users/qucit/.rvm/gems/ruby-2.7.2/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8193401
Xcode: 13.3/13E113 - /usr/bin/xcodebuild
Languages:
Java: 11.0.14.1 - /Library/Java/JavaVirtualMachines/temurin-11.jdk/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.0 => 0.68.0
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found
Steps to reproduce
Quite straightforward.
Disable fabric, importe NativeModules and try to use I18nManager and SettingsManager, no issue.
Enable fabric, do the the same thing => crash because NativeModules is {}
Snack, code example, screenshot, or link to a repository
No response