Correctly translate nowrap -> NO_WRAP

Summary: The java enum was recently changed from NOWRAP -> NO_WRAP so the translation from js failed. This fixes that.

Reviewed By: limichaelc

Differential Revision: D4186869

fbshipit-source-id: fe35211a6632d80356d35a01a079279ef4bd7006
This commit is contained in:
Emil Sjolander 2016-11-15 18:52:09 -08:00 committed by Facebook Github Bot
parent 7e8bef872a
commit a07abe7188
1 changed files with 7 additions and 2 deletions

View File

@ -86,8 +86,13 @@ public class LayoutShadowNode extends ReactShadowNode {
@ReactProp(name = ViewProps.FLEX_WRAP)
public void setFlexWrap(@Nullable String flexWrap) {
setFlexWrap(
flexWrap == null ? CSSWrap.NO_WRAP : CSSWrap.valueOf(flexWrap.toUpperCase(Locale.US)));
if (flexWrap == null || flexWrap.equals("nowrap")) {
setFlexWrap(CSSWrap.NO_WRAP);
} else if (flexWrap.equals("wrap")) {
setFlexWrap(CSSWrap.WRAP);
} else {
throw new IllegalArgumentException("Unknown flexWrap value: " + flexWrap);
}
}
@ReactProp(name = ViewProps.ALIGN_SELF)