TextInput: don't call Paper UIManager setViewLocalData in Fabric

Summary:
In Paper this call causes Yoga to remeasure the tree. We don't need to do this in Fabric, and all the data contained in `ReactTextInputLocalData` is already set on the underlying EditText View.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18870491

fbshipit-source-id: a982a708b810d45f70ad4981a963bb4ae798c83c
This commit is contained in:
Joshua Gross
2019-12-07 00:12:59 -08:00
committed by Facebook Github Bot
parent 7cfabf42b8
commit 2ee11711e0
@@ -593,11 +593,19 @@ public class ReactEditText extends EditText {
setIntrinsicContentSize();
}
// TODO T58784068: delete this method
private void setIntrinsicContentSize() {
ReactContext reactContext = (ReactContext) getContext();
UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
final ReactTextInputLocalData localData = new ReactTextInputLocalData(this);
uiManager.setViewLocalData(getId(), localData);
// This serves as a check for whether we're running under Paper or Fabric.
// By the time this is called, in Fabric we will have a state
// wrapper 100% of the time.
// Since the LocalData object is constructed by getting values from the underlying EditText
// view, we don't need to construct one or apply it at all - it provides no use in Fabric.
if (mStateWrapper == null) {
ReactContext reactContext = (ReactContext) getContext();
final ReactTextInputLocalData localData = new ReactTextInputLocalData(this);
UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class);
uiManager.setViewLocalData(getId(), localData);
}
}
/* package */ void setGravityHorizontal(int gravityHorizontal) {