mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Handle empty string returned from NativeAppearance.getColorScheme()
Reviewed By: PeteTheHeat Differential Revision: D17151675 fbshipit-source-id: 39b9a32271cd45b82faa5e0248d589ef1ed9f4c9
This commit is contained in:
committed by
Facebook Github Bot
parent
adac04601e
commit
49f59a6b9e
@@ -21,8 +21,9 @@ import invariant from 'invariant';
|
||||
type AppearanceListener = (preferences: AppearancePreferences) => void;
|
||||
const eventEmitter = new EventEmitter();
|
||||
|
||||
// TODO: (hramos) T52919652 Use ?ColorSchemeName once codegen supports union
|
||||
const nativeColorScheme: ?string =
|
||||
NativeAppearance == null ? null : NativeAppearance.getColorScheme();
|
||||
NativeAppearance == null ? null : NativeAppearance.getColorScheme() || null;
|
||||
invariant(
|
||||
nativeColorScheme === 'dark' ||
|
||||
nativeColorScheme === 'light' ||
|
||||
|
||||
Reference in New Issue
Block a user