diff --git a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.h b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.h index 27cee84ca..a08bc1096 100644 --- a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.h +++ b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.h @@ -25,5 +25,6 @@ @property (nonatomic, readonly) CKFlexboxComponentChild flexboxChild; + (instancetype)newFromRoot:(id)root; ++ (instancetype)newFromRoot:(id)root parentKey:(NSString *)parentKey; @end diff --git a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.mm b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.mm index 11d2f6c3e..485db2c36 100644 --- a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.mm +++ b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentLayoutWrapper.mm @@ -44,6 +44,10 @@ static CKFlexboxComponentChild findFlexboxLayoutParams(CKComponent *parent, CKCo @implementation SKComponentLayoutWrapper + (instancetype)newFromRoot:(id)root { + return [self newFromRoot:root parentKey:@""]; +} + ++ (instancetype)newFromRoot:(id)root parentKey:(NSString *)parentKey { const CKComponentLayout layout = [root mountedLayout]; // Check if there is a cached wrapper. if (layout.component) { @@ -59,7 +63,7 @@ static CKFlexboxComponentChild findFlexboxLayoutParams(CKComponent *parent, CKCo SKComponentLayoutWrapper *const wrapper = [[SKComponentLayoutWrapper alloc] initWithLayout:layout position:CGPointMake(0, 0) - parentKey:[NSString stringWithFormat: @"%d.", component.treeNode.nodeIdentifier] + parentKey:[NSString stringWithFormat: @"%@%d.", parentKey, component.treeNode.nodeIdentifier] reuseWrapper:reuseWrapper rootNode: root]; // Cache the result. diff --git a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentRootViewDescriptor.mm b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentRootViewDescriptor.mm index 6e6ae5762..109099558 100644 --- a/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentRootViewDescriptor.mm +++ b/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/SKComponentRootViewDescriptor.mm @@ -32,7 +32,9 @@ } - (id)childForNode:(CKComponentRootView *)node atIndex:(NSUInteger)index { - return [SKComponentLayoutWrapper newFromRoot:node]; + auto const attachState = CKGetAttachStateForView(node); + return [SKComponentLayoutWrapper newFromRoot:node + parentKey:[NSString stringWithFormat:@"%d.", attachState.scopeIdentifier]]; } - (void)setHighlighted:(BOOL)highlighted forNode:(CKComponentRootView *)node {