Skip to content

Commit

Permalink
remove force_static from textinput module
Browse files Browse the repository at this point in the history
Summary:
changelog: [internal]

force_static doesn't need to be in here, let's remove it.

I change one module per diff. It makes it easier to land it and pinpoint where build failures are coming from.

Reviewed By: christophpurrer

Differential Revision: D56678530

fbshipit-source-id: c602e065d77fdd649c66ce2d26eee83428ef5ba8
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Apr 29, 2024
1 parent bb2c13a commit bb120ff
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#include "ImageComponentDescriptor.h"
#include <react/renderer/imagemanager/ImageManager.h>

namespace facebook::react {

ImageComponentDescriptor::ImageComponentDescriptor(
const ComponentDescriptorParameters& parameters)
: ConcreteComponentDescriptor(parameters),
imageManager_(std::make_shared<ImageManager>(contextContainer_)){};

void ImageComponentDescriptor::adopt(ShadowNode& shadowNode) const {
ConcreteComponentDescriptor::adopt(shadowNode);

auto& imageShadowNode = static_cast<ImageShadowNode&>(shadowNode);

// `ImageShadowNode` uses `ImageManager` to initiate image loading and
// communicate the loading state and results to mounting layer.
imageShadowNode.setImageManager(imageManager_);
}
} // namespace facebook::react
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,24 @@

#include <react/renderer/components/image/ImageShadowNode.h>
#include <react/renderer/core/ConcreteComponentDescriptor.h>
#include <react/renderer/imagemanager/ImageManager.h>
#include <react/utils/ContextContainer.h>

namespace facebook::react {

class ImageManager;

/*
* Descriptor for <Image> component.
*/
class ImageComponentDescriptor final
: public ConcreteComponentDescriptor<ImageShadowNode> {
public:
ImageComponentDescriptor(const ComponentDescriptorParameters& parameters)
: ConcreteComponentDescriptor(parameters),
imageManager_(std::make_shared<ImageManager>(contextContainer_)){};

void adopt(ShadowNode& shadowNode) const override {
ConcreteComponentDescriptor::adopt(shadowNode);

auto& imageShadowNode = static_cast<ImageShadowNode&>(shadowNode);
explicit ImageComponentDescriptor(
const ComponentDescriptorParameters& parameters);

// `ImageShadowNode` uses `ImageManager` to initiate image loading and
// communicate the loading state and results to mounting layer.
imageShadowNode.setImageManager(imageManager_);
}
void adopt(ShadowNode& shadowNode) const override;

private:
const SharedImageManager imageManager_;
const std::shared_ptr<ImageManager> imageManager_;
};

} // namespace facebook::react

0 comments on commit bb120ff

Please sign in to comment.