Fixes Appearance user interface style when app run from background (#46021)

Summary:
Fixes https://github.com/facebook/react-native/issues/46015.

## Changelog:

[IOS] [FIXED] - Fixes Appearance user interface style when app run from background

Pull Request resolved: https://github.com/facebook/react-native/pull/46021

Test Plan: Demo in https://github.com/facebook/react-native/issues/46015.

Reviewed By: christophpurrer

Differential Revision: D61536857

Pulled By: cipolleschi

fbshipit-source-id: ee06cb25b5fc4fa72d646efe212738e54b9ef858
This commit is contained in:
zhongwuzw
2024-08-20 10:44:41 -07:00
committed by Facebook GitHub Bot
parent 52888c0c1e
commit efa9711e35
@@ -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;
}