Skip to content

Commit

Permalink
iOS Appearance: default to light
Browse files Browse the repository at this point in the history
Summary:
For iOS < 13, default to "light" appearance, just like in Android (instead of `nil`).

This fixes the following redbox:

{F205818545}

Reviewed By: cpojer

Differential Revision: D17147970

fbshipit-source-id: b2adccd349a0a0ff7668c2f30e93164d23c3eea6
  • Loading branch information
fkgozali authored and facebook-github-bot committed Sep 4, 2019
1 parent 241091d commit 67fe9b2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions React/CoreModules/RCTAppearance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
});

traitCollection = traitCollection ?: [UITraitCollection currentTraitCollection];
return appearances[@(traitCollection.userInterfaceStyle)] ?: nil;
return appearances[@(traitCollection.userInterfaceStyle)] ?: RCTAppearanceColorSchemeLight;
}
#endif

return nil;
// Default to light on older OS version - same behavior as Android.
return RCTAppearanceColorSchemeLight;
}

@interface RCTAppearance () <NativeAppearanceSpec>
Expand Down

0 comments on commit 67fe9b2

Please sign in to comment.