Skip to content

Commit 871e14f

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Fix initial render of RN Android TextInput
Summary: This diff fixes the initial render of RN Android TextInput. The problem was that "attributedString" was not serialized until an event was sent from native side. Changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D23383969 fbshipit-source-id: 86601434b1fbaa9f712bdb79b013a1d004bc55a4
1 parent e605642 commit 871e14f

File tree

1 file changed

+2
-4
lines changed
  • ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput

1 file changed

+2
-4
lines changed

ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ folly::dynamic AndroidTextInputState::getDynamic() const {
1818
// Java doesn't need all fields, so we don't pass them along.
1919
folly::dynamic newState = folly::dynamic::object();
2020
newState["mostRecentEventCount"] = mostRecentEventCount;
21-
if (mostRecentEventCount != 0) {
22-
newState["attributedString"] = toDynamic(attributedString);
23-
newState["hash"] = newState["attributedString"]["hash"];
24-
}
21+
newState["attributedString"] = toDynamic(attributedString);
22+
newState["hash"] = newState["attributedString"]["hash"];
2523
newState["paragraphAttributes"] =
2624
toDynamic(paragraphAttributes); // TODO: can we memoize this in Java?
2725
return newState;

0 commit comments

Comments
 (0)