mirror of
https://github.com/status-im/react-native.git
synced 2025-01-15 20:15:11 +00:00
nil instead of empty RCTViewManagerUIBlock
blocks
Summary: Same as in previous diffs. Gets us into a better place to know if we really have UI updates and it's marginally more efficient. Depends on D2571143. (not really) public Reviewed By: nicklockwood Differential Revision: D2571166 fb-gh-sync-id: e8f34521ec2e12156a49f1cd655e92df1db34fca
This commit is contained in:
parent
8989ff925d
commit
28f5af0c39
@ -509,6 +509,10 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!viewsWithNewFrames.count) {
|
||||||
|
// no frame change results in no UI update block
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
// Perform layout (possibly animated)
|
// Perform layout (possibly animated)
|
||||||
return ^(__unused RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
|
return ^(__unused RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
|
||||||
RCTResponseSenderBlock callback = self->_layoutAnimation.callback;
|
RCTResponseSenderBlock callback = self->_layoutAnimation.callback;
|
||||||
@ -583,11 +587,13 @@ extern NSString *RCTBridgeModuleNameForClass(Class cls);
|
|||||||
NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1];
|
NSMutableSet *applierBlocks = [NSMutableSet setWithCapacity:1];
|
||||||
[topView collectUpdatedProperties:applierBlocks parentProperties:@{}];
|
[topView collectUpdatedProperties:applierBlocks parentProperties:@{}];
|
||||||
|
|
||||||
[self addUIBlock:^(__unused RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
|
if (applierBlocks.count) {
|
||||||
for (RCTApplierBlock block in applierBlocks) {
|
[self addUIBlock:^(__unused RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
|
||||||
block(viewRegistry);
|
for (RCTApplierBlock block in applierBlocks) {
|
||||||
}
|
block(viewRegistry);
|
||||||
}];
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user