Avoid serializing UndefinedColor when rendering texts

Summary: This diff avoids the serialization of color that are set as: "UndefinedColor". This allows the text rendering system to set the default color in the native side

Reviewed By: shergin

Differential Revision: D10275834

fbshipit-source-id: b81c7a5995bef65e04a246d99f44ff10cb20f548
This commit is contained in:
David Vacca 2018-10-09 16:30:22 -07:00 коммит произвёл Facebook Github Bot
Родитель 397573ffed
Коммит 28d80e4717
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -387,7 +387,9 @@ inline folly::dynamic toDynamic(
inline folly::dynamic toDynamic(const TextAttributes &textAttributes) {
auto _textAttributes = folly::dynamic::object();
if (textAttributes.foregroundColor) {
_textAttributes("foregroundColor", toDynamic(textAttributes.foregroundColor));
}
if (textAttributes.backgroundColor) {
_textAttributes(
"backgroundColor", toDynamic(textAttributes.backgroundColor));