Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ folly::dynamic ImagePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);

if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
return result;
}
Expand Down Expand Up @@ -740,7 +740,7 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);

if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}

if (color != oldProps->color) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ folly::dynamic ImagePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);

if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
return result;
}
Expand Down Expand Up @@ -740,7 +740,7 @@ folly::dynamic MultiNativePropNativeComponentViewProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);

if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}

if (color != oldProps->color) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function generatePropsDiffString(
case 'ImageSourcePrimitive':
return `
if (${prop.name} != oldProps->${prop.name}) {
result["${prop.name}"] = ${prop.name}.toDynamic();
result["${prop.name}"] = toDynamic(${prop.name});
}`;
case 'ImageRequestPrimitive':
// Shouldn't be used in props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ folly::dynamic ImagePropNativeComponentProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);

if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}
return result;
}
Expand Down Expand Up @@ -1152,7 +1152,7 @@ folly::dynamic ImageColorPropNativeComponentProps::getDiffProps(
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);

if (thumbImage != oldProps->thumbImage) {
result[\\"thumbImage\\"] = thumbImage.toDynamic();
result[\\"thumbImage\\"] = toDynamic(thumbImage);
}

if (color != oldProps->color) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,17 @@ folly::dynamic ImageProps::getDiffProps(const Props* prevProps) const {
if (sources != oldProps->sources) {
auto sourcesArray = folly::dynamic::array();
for (const auto& source : sources) {
sourcesArray.push_back(source.toDynamic());
sourcesArray.push_back(toDynamic(source));
}
result["source"] = sourcesArray;
}

if (defaultSource != oldProps->defaultSource) {
result["defaultSource"] = defaultSource.toDynamic();
result["defaultSource"] = toDynamic(defaultSource);
}

if (loadingIndicatorSource != oldProps->loadingIndicatorSource) {
result["loadingIndicatorSource"] = loadingIndicatorSource.toDynamic();
result["loadingIndicatorSource"] = toDynamic(loadingIndicatorSource);
}

if (resizeMode != oldProps->resizeMode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ class ImageSource {
#endif
};

#ifdef RN_SERIALIZABLE_STATE
inline folly::dynamic toDynamic(const ImageSource& imageSource) {
return imageSource.toDynamic();
}
#endif

using ImageSources = std::vector<ImageSource>;

enum class ImageResizeMode {
Expand Down
Loading