Fix text not being restored from state in TextInput

Summary:
Changelog: [internal]

Restore text value from state when re-initialising RCTTextInputComponentView

Reviewed By: shergin

Differential Revision: D22844624

fbshipit-source-id: b47e3fe890793f8de429b637535d641262c42be2
This commit is contained in:
Samuel Susla
2020-08-11 13:18:40 -07:00
committed by Facebook GitHub Bot
parent 7e0824027e
commit 22c1032dbc
@@ -222,8 +222,13 @@ using namespace facebook::react;
return;
}
auto data = _state->getData();
if (!oldState) {
_mostRecentEventCount = _state->getData().mostRecentEventCount;
}
if (_mostRecentEventCount == _state->getData().mostRecentEventCount) {
auto data = _state->getData();
_comingFromJS = YES;
[self _setAttributedString:RCTNSAttributedStringFromAttributedStringBox(data.attributedStringBox)];
_comingFromJS = NO;