Skip to content

Commit

Permalink
fix(react-native): check for nullability in SettingsManager?.settings (
Browse files Browse the repository at this point in the history
…#758)

This check seems necessary for the new architecture (on React Native
0.77) to prevent an immediate crash.

Closes #757
  • Loading branch information
quinnturner authored Jan 24, 2025
1 parent 76347d8 commit 3449934
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/sdk/react-native/src/platform/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NativeModules, Platform } from 'react-native';
*/
const locale =
Platform.OS === 'ios'
? NativeModules.SettingsManager?.settings.AppleLocale // iOS
? NativeModules.SettingsManager?.settings?.AppleLocale // iOS
: NativeModules.I18nManager?.localeIdentifier;

export default locale;

0 comments on commit 3449934

Please sign in to comment.