Closed artyorsh closed 1 month ago
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch @launchdarkly/react-native-client-sdk@10.1.3 for the project I'm working on.
@launchdarkly/react-native-client-sdk@10.1.3
Enabling new architecture in react native project produces runtime errors while trying to access nullable NativeModules.SettingsManager.
NativeModules.SettingsManager
Here is the diff that solved my problem:
diff --git a/node_modules/@launchdarkly/react-native-client-sdk/dist/src/platform/locale.js b/node_modules/@launchdarkly/react-native-client-sdk/dist/src/platform/locale.js index 725ef98..c4cdcdd 100644 --- a/node_modules/@launchdarkly/react-native-client-sdk/dist/src/platform/locale.js +++ b/node_modules/@launchdarkly/react-native-client-sdk/dist/src/platform/locale.js @@ -5,7 +5,7 @@ import { NativeModules, Platform } from 'react-native'; * https://dev.to/medaimane/localization-and-internationalization-in-react-native-reaching-global-audiences-3acj */ const locale = Platform.OS === 'ios' - ? NativeModules.SettingsManager.settings.AppleLocale // iOS + ? NativeModules.SettingsManager?.settings.AppleLocale // iOS : (_a = NativeModules.I18nManager) === null || _a === void 0 ? void 0 : _a.localeIdentifier; export default locale; //# sourceMappingURL=locale.js.map \ No newline at end of file
This issue body was partially generated by patch-package.
Thanks for submitting this. We are looking into it. Internally logged as 244927.
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch
@launchdarkly/react-native-client-sdk@10.1.3
for the project I'm working on.Enabling new architecture in react native project produces runtime errors while trying to access nullable
NativeModules.SettingsManager
.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.