diff --git a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm index bb811e260e2..32ebeef2503 100644 --- a/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm @@ -20,6 +20,8 @@ #import "RCTConversions.h" #import "RCTFabricComponentsPlugins.h" +using namespace facebook::react; + @interface RCTImageComponentView () @end @@ -79,8 +81,7 @@ [super updateProps:props oldProps:oldProps]; } -- (void)updateState:(facebook::react::State::Shared const &)state - oldState:(facebook::react::State::Shared const &)oldState +- (void)updateState:(State::Shared const &)state oldState:(State::Shared const &)oldState { _state = std::static_pointer_cast(state); auto _oldState = std::static_pointer_cast(oldState); diff --git a/ReactCommon/fabric/components/image/ImageShadowNode.h b/ReactCommon/fabric/components/image/ImageShadowNode.h index 0dbd5f8990b..592a67b505a 100644 --- a/ReactCommon/fabric/components/image/ImageShadowNode.h +++ b/ReactCommon/fabric/components/image/ImageShadowNode.h @@ -35,6 +35,14 @@ class ImageShadowNode final : public ConcreteViewShadowNode< */ void setImageManager(const SharedImageManager &imageManager); + static ImageState initialStateData( + ShadowNodeFragment const &fragment, + SurfaceId const surfaceId, + ComponentDescriptor const &componentDescriptor) { + auto imageSource = ImageSource{ImageSource::Type::Invalid}; + return {imageSource, {imageSource, nullptr}}; + } + #pragma mark - LayoutableShadowNode void layout(LayoutContext layoutContext) override; diff --git a/ReactCommon/fabric/components/image/ImageState.h b/ReactCommon/fabric/components/image/ImageState.h index 8d591af4d42..5280e4b0c65 100644 --- a/ReactCommon/fabric/components/image/ImageState.h +++ b/ReactCommon/fabric/components/image/ImageState.h @@ -24,8 +24,6 @@ class ImageState final { imageRequest_( std::make_shared(std::move(imageRequest))){}; - ImageState() = default; - /* * Returns stored ImageSource object. */