Summary: This solves the watch tab crash discussed here D15266478, which got reverted. Bug: [Here](diffusion/FBS/browse/master/xplat/sonar/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.mm;57c596a566bec49e343af51b93df65ed1377a2b9$338), when the node is `CKComponentRootView` the `[descriptor childForNode: node atIndex: i]` returns `SKComponentLayoutWrapper`. In the next iteration of the loop, node is `SKComponentLayoutWrapper`, the `[descriptor childForNode: node atIndex: i]` returns `CKComponentRootView`, and hence the infinite recursion I also tested T44431259, it is not regressed. Reviewed By: passy Differential Revision: D15451821 fbshipit-source-id: 25f10112f5f52bb1fa964316a4c7e91a3b29156d
29 lines
1008 B
Objective-C
29 lines
1008 B
Objective-C
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the LICENSE
|
|
* file in the root directory of this source tree.
|
|
*/
|
|
#import <Foundation/Foundation.h>
|
|
|
|
#import <ComponentKit/CKComponentLayout.h>
|
|
#import <ComponentKit/CKFlexboxComponent.h>
|
|
|
|
@protocol CKInspectableView;
|
|
|
|
@interface SKComponentLayoutWrapper : NSObject
|
|
|
|
@property (nonatomic, weak, readonly) CKComponent *component;
|
|
@property (nonatomic, readonly) NSString *identifier;
|
|
@property (nonatomic, readonly) CGSize size;
|
|
@property (nonatomic, readonly) CGPoint position;
|
|
@property (nonatomic, readonly) std::vector<SKComponentLayoutWrapper *> children;
|
|
@property (nonatomic, readonly) id<CKInspectableView> rootNode;
|
|
// Null for layouts which are not direct children of a CKFlexboxComponent
|
|
@property (nonatomic, readonly) BOOL isFlexboxChild;
|
|
@property (nonatomic, readonly) CKFlexboxComponentChild flexboxChild;
|
|
|
|
+ (instancetype)newFromRoot:(id<CKInspectableView>)root;
|
|
|
|
@end
|