mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-03 09:35:11 +08:00
Expose hash as part of text localdata
Summary: In this diff we expose the text local data hash to android, this will be used in the future to cache metadata when rendering text in android Reviewed By: shergin Differential Revision: D13161873 fbshipit-source-id: cd13a4beba75a3fe62ac9ff3def26f88e874834b
This commit is contained in:
committed by
Facebook Github Bot
parent
3b4d6d5ef5
commit
eec9e4a2f9
@@ -487,6 +487,8 @@ inline folly::dynamic toDynamic(const AttributedString &attributedString) {
|
||||
fragments.push_back(dynamicFragment);
|
||||
}
|
||||
value("fragments", fragments);
|
||||
value(
|
||||
"hash", std::hash<facebook::react::AttributedString>{}(attributedString));
|
||||
value("string", attributedString.getString());
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ inline folly::dynamic toDynamic(const ParagraphLocalData ¶graphLocalData) {
|
||||
folly::dynamic newLocalData = folly::dynamic::object();
|
||||
newLocalData["attributedString"] =
|
||||
toDynamic(paragraphLocalData.getAttributedString());
|
||||
newLocalData["hash"] = newLocalData["attributedString"]["hash"];
|
||||
return newLocalData;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user