Skip to content

Commit 855f227

Browse files
committed
fix: don't report trait changes when in background
1 parent b29b393 commit 855f227

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react-native/React/Base/RCTRootView.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ - (void)contentViewInvalidated
368368
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
369369
{
370370
[super traitCollectionDidChange:previousTraitCollection];
371+
if (RCTSharedApplication().applicationState == UIApplicationStateBackground) {
372+
return;
373+
}
371374

372375
[[NSNotificationCenter defaultCenter]
373376
postNotificationName:RCTUserInterfaceStyleDidChangeNotification

0 commit comments

Comments
 (0)