Fix NativePlatformConstants

Summary:
When in debug mode, PlatformConstants doesn't have a `ServerHost` constant. This wasn't captured by `NativePlatformConstants`.

Changelog:
[Android][Fixed] - Make sure ServerHost is optional in NativePlatformConstants.js

Reviewed By: rickhanlonii

Differential Revision: D19091270

fbshipit-source-id: 4b3ac73a4ab6111b3e433ecca01cc769e8cdec6b
This commit is contained in:
Ramanpreet Nara
2019-12-18 08:18:40 -08:00
committed by Facebook Github Bot
parent 38af48d5fd
commit 048f88a33a
4 changed files with 7 additions and 6 deletions
@@ -47,11 +47,12 @@ public abstract class NativePlatformConstantsAndroidSpec extends ReactContextBas
"Version",
"reactNativeVersion",
"Model",
"ServerHost",
"isTesting",
"Release"
));
Set<String> optionalFlowConstants = new HashSet<>();
Set<String> optionalFlowConstants = new HashSet<>(Arrays.asList(
"ServerHost"
));
Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
undeclaredConstants.removeAll(obligatoryFlowConstants);
undeclaredConstants.removeAll(optionalFlowConstants);