Fix RN Litho invalidations

Summary:
We were seeing a bug where embedded feed stories showed the loading spinner forever until a scroll event occurred. Embedded feed stories are built on top of our RN + Litho integration which requires additional logic to support remeasuring the shadow tree when the intrinsic size of the litho component changes (aka wrap_content). Previously, we simply overrode requestLayout() of ReactLithoView to inform the shadow tree that that node needs to be dirtied -- in which case a
subsequent layout pass would resolve these changes. This worked fine in dev builds, but it turns out that release builds never received a subsequent layout pass. Dev builds apparently have a loop that dispatches view updates every second or so while release doesn't (not sure why), but that was the reason why the dev version eventually invalidated the views. The solution here is to simply always invoke a view update when any embedded Litho component requires a relayout.

Reviewed By: mdvacca

Differential Revision: D8983995

fbshipit-source-id: 53c528b3c00aad2bbe8e7f6360dc8e1594da1298
This commit is contained in:
Andrew Chen (Eng) 2018-07-27 14:07:17 -07:00 committed by Facebook Github Bot
parent 7205232792
commit 27b3aecb3d
1 changed files with 1 additions and 0 deletions

View File

@ -777,6 +777,7 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
return;
}
node.dirty();
mUIImplementation.dispatchViewUpdates(-1);
}
/**