Skip to content

Commit 8ff641b

Browse files
authored
fix: Added iOS SettingsManager null check. (#471)
Fixes this [gh issue](#462). Enabling new architecture in react native project produces runtime errors while trying to access nullable `NativeModules.SettingsManager`.
1 parent 55b6f81 commit 8ff641b

File tree

1 file changed

+1
-1
lines changed
  • packages/sdk/react-native/src/platform

1 file changed

+1
-1
lines changed

packages/sdk/react-native/src/platform/locale.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { NativeModules, Platform } from 'react-native';
66
*/
77
const locale =
88
Platform.OS === 'ios'
9-
? NativeModules.SettingsManager.settings.AppleLocale // iOS
9+
? NativeModules.SettingsManager?.settings.AppleLocale // iOS
1010
: NativeModules.I18nManager?.localeIdentifier;
1111

1212
export default locale;

0 commit comments

Comments
 (0)