Skip to content

Commit

Permalink
Fix initial render of RN Android TextInput
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Aug 28, 2020
1 parent e605642 commit 871e14f
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ folly::dynamic AndroidTextInputState::getDynamic() const {
// Java doesn't need all fields, so we don't pass them along.
folly::dynamic newState = folly::dynamic::object();
newState["mostRecentEventCount"] = mostRecentEventCount;
if (mostRecentEventCount != 0) {
newState["attributedString"] = toDynamic(attributedString);
newState["hash"] = newState["attributedString"]["hash"];
}
newState["attributedString"] = toDynamic(attributedString);
newState["hash"] = newState["attributedString"]["hash"];
newState["paragraphAttributes"] =
toDynamic(paragraphAttributes); // TODO: can we memoize this in Java?
return newState;
Expand Down

0 comments on commit 871e14f

Please sign in to comment.