@@ -18,43 +18,83 @@ ImageProps::ImageProps(
1818 const RawProps &rawProps)
1919 : ViewProps(context, sourceProps, rawProps),
2020 sources (
21- convertRawProp (context, rawProps, " source" , sourceProps.sources, {})),
22- defaultSources(convertRawProp(
23- context,
24- rawProps,
25- " defaultSource" ,
26- sourceProps.defaultSources,
27- {})),
28- resizeMode(convertRawProp(
29- context,
30- rawProps,
31- " resizeMode" ,
32- sourceProps.resizeMode,
33- ImageResizeMode::Stretch)),
34- blurRadius(convertRawProp(
35- context,
36- rawProps,
37- " blurRadius" ,
38- sourceProps.blurRadius,
39- {})),
40- capInsets(convertRawProp(
41- context,
42- rawProps,
43- " capInsets" ,
44- sourceProps.capInsets,
45- {})),
46- tintColor(convertRawProp(
47- context,
48- rawProps,
49- " tintColor" ,
50- sourceProps.tintColor,
51- {})),
52- internal_analyticTag(convertRawProp(
53- context,
54- rawProps,
55- " internal_analyticTag" ,
56- sourceProps.internal_analyticTag,
57- {})) {}
21+ Props::enablePropIteratorSetter ? sourceProps.sources
22+ : convertRawProp(
23+ context,
24+ rawProps,
25+ " source" ,
26+ sourceProps.sources,
27+ {})),
28+ defaultSources(
29+ Props::enablePropIteratorSetter ? sourceProps.defaultSources
30+ : convertRawProp(
31+ context,
32+ rawProps,
33+ " defaultSource" ,
34+ sourceProps.defaultSources,
35+ {})),
36+ resizeMode(
37+ Props::enablePropIteratorSetter ? sourceProps.resizeMode
38+ : convertRawProp(
39+ context,
40+ rawProps,
41+ " resizeMode" ,
42+ sourceProps.resizeMode,
43+ ImageResizeMode::Stretch)),
44+ blurRadius(
45+ Props::enablePropIteratorSetter ? sourceProps.blurRadius
46+ : convertRawProp(
47+ context,
48+ rawProps,
49+ " blurRadius" ,
50+ sourceProps.blurRadius,
51+ {})),
52+ capInsets(
53+ Props::enablePropIteratorSetter ? sourceProps.capInsets
54+ : convertRawProp(
55+ context,
56+ rawProps,
57+ " capInsets" ,
58+ sourceProps.capInsets,
59+ {})),
60+ tintColor(
61+ Props::enablePropIteratorSetter ? sourceProps.tintColor
62+ : convertRawProp(
63+ context,
64+ rawProps,
65+ " tintColor" ,
66+ sourceProps.tintColor,
67+ {})),
68+ internal_analyticTag(
69+ Props::enablePropIteratorSetter
70+ ? sourceProps.internal_analyticTag
71+ : convertRawProp(
72+ context,
73+ rawProps,
74+ " internal_analyticTag" ,
75+ sourceProps.internal_analyticTag,
76+ {})) {}
77+
78+ void ImageProps::setProp (
79+ const PropsParserContext &context,
80+ RawPropsPropNameHash hash,
81+ const char *propName,
82+ RawValue const &value) {
83+ // All Props structs setProp methods must always, unconditionally,
84+ // call all super::setProp methods, since multiple structs may
85+ // reuse the same values.
86+ ViewProps::setProp (context, hash, propName, value);
87+
88+ switch (hash) {
89+ RAW_SET_PROP_SWITCH_CASE (sources, " source" , {});
90+ RAW_SET_PROP_SWITCH_CASE (defaultSources, " defaultSource" , {});
91+ RAW_SET_PROP_SWITCH_CASE_BASIC (resizeMode, ImageResizeMode::Stretch);
92+ RAW_SET_PROP_SWITCH_CASE_BASIC (blurRadius, {});
93+ RAW_SET_PROP_SWITCH_CASE_BASIC (capInsets, {});
94+ RAW_SET_PROP_SWITCH_CASE_BASIC (tintColor, {});
95+ RAW_SET_PROP_SWITCH_CASE_BASIC (internal_analyticTag, {});
96+ }
97+ }
5898
5999} // namespace react
60100} // namespace facebook
0 commit comments