diff --git a/packages/react-native/React/CoreModules/RCTAppearance.mm b/packages/react-native/React/CoreModules/RCTAppearance.mm index 457a1d8b966..b5bcc313a82 100644 --- a/packages/react-native/React/CoreModules/RCTAppearance.mm +++ b/packages/react-native/React/CoreModules/RCTAppearance.mm @@ -70,8 +70,13 @@ NSString *RCTColorSchemePreference(UITraitCollection *traitCollection) return appearances[@(traitCollection.userInterfaceStyle)]; } + if (!traitCollection) { + traitCollection = [UITraitCollection currentTraitCollection]; + } + UIUserInterfaceStyle systemStyle = sUseKeyWindowForSystemStyle ? RCTKeyWindow().traitCollection.userInterfaceStyle : traitCollection.userInterfaceStyle; + return appearances[@(systemStyle)] ?: RCTAppearanceColorSchemeLight; }