Skip to content

Commit 6ccdf85

Browse files
davidaureliofacebook-github-bot
authored andcommitted
Publish event when visiting nodes during layout
Summary: @public Publish an event when visiting nodes during layouts. Reviewed By: SidharthGuglani Differential Revision: D15206965 fbshipit-source-id: c201f084b1d4186bc64560b8033be965f2549236
1 parent 7d44113 commit 6ccdf85

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ReactCommon/yoga/yoga/Yoga.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3667,6 +3667,9 @@ bool YGLayoutNodeInternal(
36673667
const YGConfigRef config,
36683668
YGMarkerLayoutData& layoutMarkerData,
36693669
void* const layoutContext) {
3670+
#ifdef YG_ENABLE_EVENTS
3671+
Event::publish<Event::NodeLayout>(node);
3672+
#endif
36703673
YGLayout* layout = &node->getLayout();
36713674

36723675
gDepth++;

ReactCommon/yoga/yoga/events.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace facebook {
1515
namespace yoga {
1616

1717
struct Event {
18-
enum Type { NodeAllocation, NodeDeallocation };
18+
enum Type { NodeAllocation, NodeDeallocation, NodeLayout };
1919
class Data;
2020
using Subscriber = void(const YGNode&, Type, Data);
2121

0 commit comments

Comments
 (0)