mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
b41307af77
commit
8b0ccd2bdb
+4
-2
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user