Fix RN Android codegen to support null values for Color typed props

Summary:
This diff fixes the RN Android codegen to support null values for Color typed props.
This was already supported but it recently changed as part of D20169335, when we added the new prop type "color".

changelog: [internal]

Reviewed By: TheSavior

Differential Revision: D20213689

fbshipit-source-id: 42d624de3d1296582f4dcc9c7decd0c02aacca98
This commit is contained in:
David Vacca
2020-03-03 00:52:03 -08:00
committed by Facebook Github Bot
parent b41307af77
commit 8b0ccd2bdb
@@ -398,11 +398,13 @@ public class ReactPropertyProcessor extends AbstractProcessor {
switch (classInfo.getType()) {
case VIEW_MANAGER:
return builder.add(
"$T.getColor(value, view.getContext())",
"value == null ? $L : $T.getColor(value, view.getContext())",
info.mProperty.defaultInt(),
com.facebook.react.bridge.ColorPropConverter.class);
case SHADOW_NODE:
return builder.add(
"$T.getColor(value, node.getThemedContext())",
"value == null ? $L : $T.getColor(value, node.getThemedContext())",
info.mProperty.defaultInt(),
com.facebook.react.bridge.ColorPropConverter.class);
}
} else if (propertyType.equals(TypeName.INT)) {