mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
7d44113bee
commit
6ccdf85cef
@@ -3667,6 +3667,9 @@ bool YGLayoutNodeInternal(
|
||||
const YGConfigRef config,
|
||||
YGMarkerLayoutData& layoutMarkerData,
|
||||
void* const layoutContext) {
|
||||
#ifdef YG_ENABLE_EVENTS
|
||||
Event::publish<Event::NodeLayout>(node);
|
||||
#endif
|
||||
YGLayout* layout = &node->getLayout();
|
||||
|
||||
gDepth++;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace facebook {
|
||||
namespace yoga {
|
||||
|
||||
struct Event {
|
||||
enum Type { NodeAllocation, NodeDeallocation };
|
||||
enum Type { NodeAllocation, NodeDeallocation, NodeLayout };
|
||||
class Data;
|
||||
using Subscriber = void(const YGNode&, Type, Data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user