Optimize the update of state during first render of a View

Summary: This is an optimization to avoid transfering updateState instructions twice during the frist render of a view (same a props)

Reviewed By: shergin

Differential Revision: D15476041

fbshipit-source-id: 8a62035dbbb63c93f86a2f8d217986a325cb1805
This commit is contained in:
David Vacca 2019-05-24 11:22:09 -07:00 коммит произвёл Facebook Github Bot
Родитель cd5fe06abe
Коммит 92f8fd22e2
1 изменённых файлов: 6 добавлений и 6 удалений

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

@ -458,6 +458,12 @@ void Binding::schedulerDidFinishTransaction(
deletedViewTags.end()) {
mountItems[position++] =
createUpdatePropsMountItem(javaUIManager_, mutation);
// State
if (mutation.newChildShadowView.state) {
mountItems[position++] =
createUpdateStateMountItem(javaUIManager_, mutation);
}
}
// LocalData
@ -472,12 +478,6 @@ void Binding::schedulerDidFinishTransaction(
if (updateLayoutMountItem) {
mountItems[position++] = updateLayoutMountItem;
}
// State
if (mutation.newChildShadowView.state) {
mountItems[position++] =
createUpdateStateMountItem(javaUIManager_, mutation);
}
}
// EventEmitter