Fixes Image load event in new arch (#44918)

Summary:
Fixes https://github.com/facebook/react-native/issues/44896. cc cipolleschi

## Changelog:

[IOS] [FIXED] - Fixes Image load event in new arch

Pull Request resolved: https://github.com/facebook/react-native/pull/44918

Test Plan: https://github.com/facebook/react-native/issues/44896

Reviewed By: dmytrorykun

Differential Revision: D59108500

Pulled By: cipolleschi

fbshipit-source-id: 1fad4f82288141e9fc37f525be7073deb81c542c
This commit is contained in:
zhongwuzw
2024-06-28 04:35:39 -07:00
committed by Facebook GitHub Bot
parent e320ab47cf
commit 7698cd0953
@@ -136,7 +136,10 @@ using namespace facebook::react;
return;
}
static_cast<const ImageEventEmitter &>(*_eventEmitter).onLoad(_state->getData().getImageSource());
auto imageSource = _state->getData().getImageSource();
imageSource.size = {image.size.width, image.size.height};
static_cast<const ImageEventEmitter &>(*_eventEmitter).onLoad(imageSource);
static_cast<const ImageEventEmitter &>(*_eventEmitter).onLoadEnd();
const auto &imageProps = static_cast<const ImageProps &>(*_props);