File tree Expand file tree Collapse file tree
packages/react-native-codegen
deep_imports/__tests__/components/__snapshots__
namespaced/__tests__/components/__snapshots__
src/generators/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -745,6 +745,12 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
745745 result[\\"thumbTintColor\\"] = *thumbTintColor;
746746 }
747747
748+ if (point != oldProps - > point ) {
749+ folly::dynamic pointResult = folly ::dynamic ::object ();
750+ pointResult [\\" x\\ " ] = point .x ;
751+ pointResult [\\" y\\ " ] = point .y ;
752+ result [\\" point\\ " ] = pointResult ;
753+ }
748754 return result ;
749755}
750756#endif
@@ -888,6 +894,12 @@ folly::dynamic PointPropNativeComponentViewProps::getDiffProps(
888894 }
889895 folly::dynamic result = HostPlatformViewProps ::getDiffProps (prevProps );
890896
897+ if (startPoint != oldProps - > startPoint ) {
898+ folly::dynamic pointResult = folly ::dynamic ::object ();
899+ pointResult [\\" x\\ " ] = startPoint .x ;
900+ pointResult [\\" y\\ " ] = startPoint .y ;
901+ result [\\" startPoint\\ " ] = pointResult ;
902+ }
891903 return result ;
892904}
893905#endif
Original file line number Diff line number Diff line change @@ -745,6 +745,12 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
745745 result[\\"thumbTintColor\\"] = *thumbTintColor;
746746 }
747747
748+ if (point != oldProps - > point ) {
749+ folly::dynamic pointResult = folly ::dynamic ::object ();
750+ pointResult [\\" x\\ " ] = point .x ;
751+ pointResult [\\" y\\ " ] = point .y ;
752+ result [\\" point\\ " ] = pointResult ;
753+ }
748754 return result ;
749755}
750756#endif
@@ -888,6 +894,12 @@ folly::dynamic PointPropNativeComponentViewProps::getDiffProps(
888894 }
889895 folly::dynamic result = HostPlatformViewProps ::getDiffProps (prevProps );
890896
897+ if (startPoint != oldProps - > startPoint ) {
898+ folly::dynamic pointResult = folly ::dynamic ::object ();
899+ pointResult [\\" x\\ " ] = startPoint .x ;
900+ pointResult [\\" y\\ " ] = startPoint .y ;
901+ result [\\" startPoint\\ " ] = pointResult ;
902+ }
891903 return result ;
892904}
893905#endif
Original file line number Diff line number Diff line change @@ -102,13 +102,21 @@ function generatePropsDiffString(
102102 if (${ prop . name } != oldProps->${ prop . name } ) {
103103 result["${ prop . name } "] = *${ prop . name } ;
104104 }` ;
105+ case 'ImageSourcePrimitive' :
106+ return '' ;
105107 case 'ImageRequestPrimitive' :
106108 // Shouldn't be used in props
107109 throw new Error (
108110 'ImageRequestPrimitive should not be used in Props' ,
109111 ) ;
110- case 'ImageSourcePrimitive' :
111112 case 'PointPrimitive' :
113+ return `
114+ if (${ prop . name } != oldProps->${ prop . name } ) {
115+ folly::dynamic pointResult = folly::dynamic::object();
116+ pointResult["x"] = ${ prop . name } .x;
117+ pointResult["y"] = ${ prop . name } .y;
118+ result["${ prop . name } "] = pointResult;
119+ }` ;
112120 case 'EdgeInsetsPrimitive' :
113121 case 'DimensionPrimitive' :
114122 // TODO: Implement diffProps for complex types
Original file line number Diff line number Diff line change @@ -1157,6 +1157,12 @@ folly::dynamic ImageColorPropNativeComponentProps::getDiffProps(
11571157 result[\\"thumbTintColor\\"] = * thumbTintColor ;
11581158 }
11591159
1160+ if (point != oldProps->point) {
1161+ folly ::dynamic pointResult = folly ::dynamic ::object ();
1162+ pointResult[\\"x\\"] = point .x ;
1163+ pointResult[\\"y\\"] = point .y ;
1164+ result[\\"point\\"] = pointResult ;
1165+ }
11601166 return result;
11611167}
11621168#endif
@@ -1296,6 +1302,12 @@ folly::dynamic PointPropNativeComponentProps::getDiffProps(
12961302 }
12971303 folly ::dynamic result = HostPlatformViewProps ::getDiffProps (prevProps );
12981304
1305+ if (startPoint != oldProps->startPoint) {
1306+ folly ::dynamic pointResult = folly ::dynamic ::object ();
1307+ pointResult[\\"x\\"] = startPoint .x ;
1308+ pointResult[\\"y\\"] = startPoint .y ;
1309+ result[\\"startPoint\\"] = pointResult ;
1310+ }
12991311 return result;
13001312}
13011313#endif
You can’t perform that action at this time.
0 commit comments