Fabric: Remove designated initializers in Image (#23439)

Summary:
This pull request removes the designated initializers in `react/components/image/**` to improve portability.

[General] [Changed] - Fabric: Remove designated initializers in Image
Pull Request resolved: https://github.com/facebook/react-native/pull/23439

Differential Revision: D14298888

Pulled By: shergin

fbshipit-source-id: 9b6ad5fdcec4d3b19b8d69afac80ce18d37f31e6
This commit is contained in:
empyrical
2019-03-03 22:35:16 -08:00
committed by Facebook Github Bot
parent cf2a289372
commit 4936a663ae
2 changed files with 7 additions and 2 deletions

View File

@@ -48,7 +48,9 @@ ImageSource ImageShadowNode::getImageSource() const {
auto sources = getProps()->sources;
if (sources.size() == 0) {
return {.type = ImageSource::Type::Invalid};
return {
/* .type = */ ImageSource::Type::Invalid,
};
}
if (sources.size() == 1) {

View File

@@ -17,7 +17,10 @@ namespace react {
inline void fromRawValue(const RawValue &value, ImageSource &result) {
if (value.hasType<std::string>()) {
result = {.type = ImageSource::Type::Remote, .uri = (std::string)value};
result = {
/* .type = */ ImageSource::Type::Remote,
/* .uri = */ (std::string)value,
};
return;
}