From b0c1bd284fa7c62eee64f4e14bf082c0e03bb764 Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Mon, 9 Oct 2017 10:35:13 -0700 Subject: [PATCH] `[RCTShadowView localData]` is now only setter. Summary: It saves 8 bytes per shadowView instance, and it is more logical because it does nothing by default. Reviewed By: javache Differential Revision: D5997804 fbshipit-source-id: c985a11aeea881e95911469e10c8c27429a2718a --- React/Views/RCTShadowView.h | 2 +- React/Views/RCTShadowView.m | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/React/Views/RCTShadowView.h b/React/Views/RCTShadowView.h index ce80dd1e1..1bbf696f7 100644 --- a/React/Views/RCTShadowView.h +++ b/React/Views/RCTShadowView.h @@ -68,7 +68,7 @@ typedef void (^RCTApplierBlock)(NSDictionary *viewRegistry * Use `-[RCTUIManager setLocalData:forView:]` to set this property * (to provide local/environmental data for a shadow view) from the main thread. */ -@property (nonatomic, strong) NSObject *localData; +- (void)setLocalData:(NSObject *)localData; /** * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is diff --git a/React/Views/RCTShadowView.m b/React/Views/RCTShadowView.m index 7b43333fc..200330aab 100644 --- a/React/Views/RCTShadowView.m +++ b/React/Views/RCTShadowView.m @@ -681,6 +681,13 @@ static inline YGSize RCTShadowViewMeasure(YGNodeRef node, float width, YGMeasure YGNodeMarkDirty(_yogaNode); } +// Local Data + +- (void)setLocalData:(__unused NSObject *)localData +{ + // Do nothing by default. +} + // Flex - (void)setFlexBasis:(YGValue)value