From 4332a2875097d68a2b059cd12875083294cdb011 Mon Sep 17 00:00:00 2001 From: Sidharth Guglani Date: Mon, 24 Jun 2019 08:29:59 -0700 Subject: [PATCH] Move event NodeLayout to end of NodeLayout step Summary: Added event NodeLayoutEnd and this is being used now instead of NodeLayout It will be used later to add more information about caches Reviewed By: davidaurelio Differential Revision: D15920935 fbshipit-source-id: c9f5e193bc8cc70d26ff5d84882d483c9b09f67d --- ReactCommon/yoga/yoga/Yoga.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ReactCommon/yoga/yoga/Yoga.cpp b/ReactCommon/yoga/yoga/Yoga.cpp index 3e4ff32edae..cfcadf5753f 100644 --- a/ReactCommon/yoga/yoga/Yoga.cpp +++ b/ReactCommon/yoga/yoga/Yoga.cpp @@ -3693,9 +3693,6 @@ bool YGLayoutNodeInternal( const YGConfigRef config, YGMarkerLayoutData& layoutMarkerData, void* const layoutContext) { -#ifdef YG_ENABLE_EVENTS - Event::publish(node, {performLayout, layoutContext}); -#endif YGLayout* layout = &node->getLayout(); gDepth++; @@ -3929,6 +3926,11 @@ bool YGLayoutNodeInternal( gDepth--; layout->generationCount = gCurrentGenerationCount; + +#ifdef YG_ENABLE_EVENTS + Event::publish(node, {performLayout, layoutContext}); +#endif + return (needToVisitNode || cachedResults == nullptr); }