mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
[React Kit] Remove embarrassing TODOs
This commit is contained in:
@@ -72,24 +72,10 @@ RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, NSInteger, RCTShadowText)
|
||||
view.truncationMode = truncationMode;
|
||||
}
|
||||
|
||||
- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowView:(RCTShadowText *)shadowView
|
||||
{
|
||||
//TODO: This could be a cleaner replacement for uiBlockToAmendWithShadowViewRegistry
|
||||
return nil;
|
||||
}
|
||||
|
||||
// TODO: the purpose of this block is effectively just to copy properties from the shadow views
|
||||
// to their equivalent UIViews. In this case, the property being copied is the attributed text,
|
||||
// but the same principle could be used to copy any property. The implementation is really ugly tho
|
||||
// because the RCTViewManager doesn't retain a reference to the views that it manages, so it basically
|
||||
// has to search the entire view hierarchy for relevant views. Not awesome. This seems like something
|
||||
// where we could introduce a generic solution - perhaps a method on RCTShadowView that is called after
|
||||
// layout to copy its properties across?
|
||||
- (RCTViewManagerUIBlock)uiBlockToAmendWithShadowViewRegistry:(RCTSparseArray *)shadowViewRegistry
|
||||
{
|
||||
NSMutableArray *uiBlocks = [NSMutableArray new];
|
||||
|
||||
// TODO: are modules global, or specific to a given rootView?
|
||||
for (RCTShadowView *rootView in shadowViewRegistry.allObjects) {
|
||||
if (![rootView isReactRootView]) {
|
||||
// This isn't a root view
|
||||
@@ -101,7 +87,6 @@ RCT_CUSTOM_SHADOW_PROPERTY(numberOfLines, NSInteger, RCTShadowText)
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: this is a slightly weird way to do this - a recursive approach would be cleaner
|
||||
RCTSparseArray *reactTaggedAttributedStrings = [[RCTSparseArray alloc] init];
|
||||
NSMutableArray *queue = [NSMutableArray arrayWithObject:rootView];
|
||||
for (NSInteger i = 0; i < [queue count]; i++) {
|
||||
|
||||
Reference in New Issue
Block a user