mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-06 22:37:14 +08:00
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:
committed by
Facebook Github Bot
parent
cf2a289372
commit
4936a663ae
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user